mirror of
https://github.com/open-webui/computer.git
synced 2026-11-23 14:10:45 -05:00
refac
This commit is contained in:
1 parent
e9dc12049b
commit
cf13e63b58
6 files changed
+394
-2
No files matched your search
@@ -2058,6 +2058,16 @@ async def run_chat_task(
|
||||
await emit(output=artifact_item)
|
||||
_sync_state()
|
||||
|
||||
if tc["name"] == "display_file":
|
||||
try:
|
||||
file_item = json.loads(result)
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
file_item = None
|
||||
if isinstance(file_item, dict) and file_item.get("type") == "file":
|
||||
output_items.append(file_item)
|
||||
await emit(output=file_item)
|
||||
_sync_state()
|
||||
|
||||
image_item = build_image_item(tc["name"], result)
|
||||
if image_item:
|
||||
output_items.append(image_item)
|
||||
|
||||
Reference in new issue
Block a user