Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display media artifact creation for ui #263

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions vision_agent/tools/meta_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import base64
import difflib
import json
import os
Expand Down Expand Up @@ -510,6 +511,19 @@ def write_media_artifact(
return f"[Invalid media type {type(media)}]"
artifacts[name] = media_bytes
print(f"[Media {name} saved]")
display(
{
MimeType.APPLICATION_ARTIFACT: json.dumps(
{
"name": name,
"action": "create",
"content": base64.b64encode(media_bytes).decode("utf-8"),
"contentType": "media_output",
}
)
},
raw=True,
)
return f"[Media {name} saved]"


Expand Down
Loading