mirror of
https://github.com/open-webui/computer.git
synced 2026-12-05 11:07:56 -05:00
refac
This commit is contained in:
1 parent
152ce6643f
commit
d22b01b555
15 files changed
+2035
-4
No files matched your search
+10
-3
@@ -944,20 +944,27 @@ async def run_chat_task(
|
||||
)
|
||||
|
||||
if should_auto:
|
||||
# Show tool call in progress BEFORE execution
|
||||
item["status"] = "in_progress"
|
||||
output_items.append(item)
|
||||
if flushed_item:
|
||||
await emit(output=flushed_item)
|
||||
await emit(output=item)
|
||||
_sync_state()
|
||||
|
||||
if name == "create_artifact":
|
||||
result = await create_artifact(**event["arguments"], workspace=workspace)
|
||||
else:
|
||||
result = await execute_tool(name, event["arguments"], {"workspace": workspace, "user_id": user_id, "model_id": model})
|
||||
|
||||
# Update status to completed
|
||||
item["status"] = "completed"
|
||||
output_items.append(item)
|
||||
result_item = {
|
||||
"type": "function_call_output",
|
||||
"call_id": event["call_id"],
|
||||
"output": result,
|
||||
}
|
||||
output_items.append(result_item)
|
||||
if flushed_item:
|
||||
await emit(output=flushed_item)
|
||||
await emit(output=item)
|
||||
await emit(output=result_item)
|
||||
_sync_state()
|
||||
|
||||
Reference in new issue
Block a user