Spaces:
Running
Running
Iisakki Rotko
commited on
Commit
•
edfa8ce
1
Parent(s):
f0674ab
feat: support for adding multiple tags at a time
Browse files- wanderlust.py +7 -18
wanderlust.py
CHANGED
@@ -160,18 +160,18 @@ def ChatInterface():
|
|
160 |
run = openai.beta.threads.runs.retrieve(
|
161 |
run_id.value, thread_id=thread.id
|
162 |
) # When run is complete
|
163 |
-
print("run", run.status)
|
164 |
except NotFoundError:
|
165 |
-
print("run not found (Yet)")
|
166 |
continue
|
167 |
if run.status == "requires_action":
|
|
|
168 |
for tool_call in run.required_action.submit_tool_outputs.tool_calls:
|
169 |
tool_output = ai_call(tool_call)
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
175 |
if run.status == "completed":
|
176 |
messages.set(
|
177 |
[
|
@@ -263,7 +263,6 @@ def ChatInterface():
|
|
263 |
repr(message),
|
264 |
classes=["chat-message", "assistant-message"],
|
265 |
)
|
266 |
-
# solara.Text(message, classes=["chat-message"])
|
267 |
with solara.Column():
|
268 |
solara.InputText(
|
269 |
label="Ask your question here",
|
@@ -275,8 +274,6 @@ def ChatInterface():
|
|
275 |
solara.ProgressLinear(result.state == solara.ResultState.RUNNING)
|
276 |
if result.state == solara.ResultState.ERROR:
|
277 |
solara.Error(repr(result.error))
|
278 |
-
# solara.Text("Thinking...")
|
279 |
-
# solara.Button("Send", on_click=lambda: messages.set(messages.value + [message_input.value]))
|
280 |
|
281 |
|
282 |
@solara.component
|
@@ -339,11 +336,3 @@ def Page():
|
|
339 |
}
|
340 |
"""
|
341 |
)
|
342 |
-
|
343 |
-
|
344 |
-
# TODO: custom layout
|
345 |
-
# @solara.component
|
346 |
-
# def Layout(children):
|
347 |
-
# with solara.v.AppBar():
|
348 |
-
# with solara.Column(children=children):
|
349 |
-
# pass
|
|
|
160 |
run = openai.beta.threads.runs.retrieve(
|
161 |
run_id.value, thread_id=thread.id
|
162 |
) # When run is complete
|
|
|
163 |
except NotFoundError:
|
|
|
164 |
continue
|
165 |
if run.status == "requires_action":
|
166 |
+
tool_outputs = []
|
167 |
for tool_call in run.required_action.submit_tool_outputs.tool_calls:
|
168 |
tool_output = ai_call(tool_call)
|
169 |
+
tool_outputs.append(tool_output)
|
170 |
+
openai.beta.threads.runs.submit_tool_outputs(
|
171 |
+
thread_id=thread.id,
|
172 |
+
run_id=run_id.value,
|
173 |
+
tool_outputs=tool_outputs,
|
174 |
+
)
|
175 |
if run.status == "completed":
|
176 |
messages.set(
|
177 |
[
|
|
|
263 |
repr(message),
|
264 |
classes=["chat-message", "assistant-message"],
|
265 |
)
|
|
|
266 |
with solara.Column():
|
267 |
solara.InputText(
|
268 |
label="Ask your question here",
|
|
|
274 |
solara.ProgressLinear(result.state == solara.ResultState.RUNNING)
|
275 |
if result.state == solara.ResultState.ERROR:
|
276 |
solara.Error(repr(result.error))
|
|
|
|
|
277 |
|
278 |
|
279 |
@solara.component
|
|
|
336 |
}
|
337 |
"""
|
338 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|