Spaces:
Running
on
Zero
Running
on
Zero
AndyC
commited on
Commit
·
6fc4e80
1
Parent(s):
5f4b02a
added file validation for pdf after inputting
Browse files
app.py
CHANGED
|
@@ -187,6 +187,8 @@ def process_history(history: list[dict]) -> list[dict]:
|
|
| 187 |
file_path = content[0]
|
| 188 |
if file_path.endswith((".mp4", ".mov")):
|
| 189 |
content_buffer.append({"type": "text", "text": "[Video uploaded previously]"})
|
|
|
|
|
|
|
| 190 |
else:
|
| 191 |
content_buffer.append({"type": "image", "url": file_path})
|
| 192 |
|
|
|
|
| 187 |
file_path = content[0]
|
| 188 |
if file_path.endswith((".mp4", ".mov")):
|
| 189 |
content_buffer.append({"type": "text", "text": "[Video uploaded previously]"})
|
| 190 |
+
elif file_path.lower().endswith(".pdf"):
|
| 191 |
+
content_buffer.append({"type": "text", "text": "[PDF uploaded previously]"})
|
| 192 |
else:
|
| 193 |
content_buffer.append({"type": "image", "url": file_path})
|
| 194 |
|