Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -156,11 +156,11 @@ def wait_on_run(client, thread, run):
|
|
156 |
return run
|
157 |
|
158 |
###
|
159 |
-
def execute_tool_call(tool_call
|
160 |
name = tool_call.function.name
|
161 |
args = json.loads(tool_call.function.arguments)
|
162 |
-
print(f"{
|
163 |
-
return tools[name](**args)
|
164 |
###
|
165 |
|
166 |
def list_run_steps(client, thread, run):
|
@@ -173,7 +173,10 @@ def list_run_steps(client, thread, run):
|
|
173 |
for step in run_steps.data:
|
174 |
step_details = step.step_details
|
175 |
show_json("step_details", step_details)
|
|
|
176 |
# TODO: execute_tool_call
|
|
|
|
|
177 |
|
178 |
return run_steps
|
179 |
|
|
|
156 |
return run
|
157 |
|
158 |
###
|
159 |
+
def execute_tool_call(tool_call):
|
160 |
name = tool_call.function.name
|
161 |
args = json.loads(tool_call.function.arguments)
|
162 |
+
print(f"{name}, {args}")
|
163 |
+
#return tools[name](**args)
|
164 |
###
|
165 |
|
166 |
def list_run_steps(client, thread, run):
|
|
|
173 |
for step in run_steps.data:
|
174 |
step_details = step.step_details
|
175 |
show_json("step_details", step_details)
|
176 |
+
|
177 |
# TODO: execute_tool_call
|
178 |
+
for tool_call in step.tool_calls:
|
179 |
+
result = execute_tool_call(tool_call)
|
180 |
|
181 |
return run_steps
|
182 |
|