mtmd: Use the base64 attachment for the UI preview instead of the file

This commit is contained in:
oobabooga 2025-08-08 20:13:54 -07:00
parent 6e9de75727
commit 8fcadff8d3
2 changed files with 2 additions and 4 deletions

View file

@ -407,11 +407,10 @@ def format_message_attachments(history, role, index):
name = html.escape(attachment["name"])
if attachment.get("type") == "image":
# Show image preview
file_path = attachment.get("file_path", "")
image_data = attachment.get("image_data", "")
attachments_html += (
f'<div class="attachment-box image-attachment">'
f'<img src="file/{file_path}" alt="{name}" class="image-preview" />'
f'<img src="{image_data}" alt="{name}" class="image-preview" />'
f'<div class="attachment-name">{name}</div>'
f'</div>'
)