Spaces:
Running
on
Zero
Running
on
Zero
fixed video persistance
Browse files
app.py
CHANGED
@@ -108,11 +108,14 @@ def process_history(history: list[dict]) -> list[dict]:
|
|
108 |
)
|
109 |
else:
|
110 |
content = item["content"]
|
111 |
-
|
112 |
-
{"type": "text", "text": content}
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
|
117 |
if content_buffer:
|
118 |
messages.append({"role": "user", "content": content_buffer})
|
|
|
108 |
)
|
109 |
else:
|
110 |
content = item["content"]
|
111 |
+
if isinstance(content, str):
|
112 |
+
content_buffer.append({"type": "text", "text": content})
|
113 |
+
elif isinstance(content, tuple) and len(content) > 0:
|
114 |
+
file_path = content[0]
|
115 |
+
if file_path.endswith((".mp4", ".mov")):
|
116 |
+
content_buffer.append({"type": "text", "text": "[Video uploaded previously]"})
|
117 |
+
else:
|
118 |
+
content_buffer.append({"type": "image", "url": file_path})
|
119 |
|
120 |
if content_buffer:
|
121 |
messages.append({"role": "user", "content": content_buffer})
|