Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -194,7 +194,7 @@ def execute_tool_call(tool_call):
|
|
194 |
|
195 |
global tools
|
196 |
|
197 |
-
tools[name](**args)
|
198 |
|
199 |
def execute_tool_calls(steps):
|
200 |
for step in steps.data:
|
@@ -206,6 +206,8 @@ def execute_tool_calls(steps):
|
|
206 |
execute_tool_call(tool_call)
|
207 |
show_json("tool_call", tool_call)
|
208 |
|
|
|
|
|
209 |
def list_messages(client, thread):
|
210 |
messages = client.beta.threads.messages.list(
|
211 |
thread_id=thread.id
|
@@ -279,7 +281,8 @@ def chat(message, history, openai_api_key):
|
|
279 |
|
280 |
steps = list_steps(client, thread, run)
|
281 |
|
282 |
-
execute_tool_calls(steps)
|
|
|
283 |
|
284 |
messages = list_messages(client, thread)
|
285 |
|
|
|
194 |
|
195 |
global tools
|
196 |
|
197 |
+
return tools[name](**args)
|
198 |
|
199 |
def execute_tool_calls(steps):
|
200 |
for step in steps.data:
|
|
|
206 |
execute_tool_call(tool_call)
|
207 |
show_json("tool_call", tool_call)
|
208 |
|
209 |
+
return "TODO: execute_tool_calls return"
|
210 |
+
|
211 |
def list_messages(client, thread):
|
212 |
messages = client.beta.threads.messages.list(
|
213 |
thread_id=thread.id
|
|
|
281 |
|
282 |
steps = list_steps(client, thread, run)
|
283 |
|
284 |
+
result = execute_tool_calls(steps)
|
285 |
+
print(result)
|
286 |
|
287 |
messages = list_messages(client, thread)
|
288 |
|