AC2513 commited on
Commit
c89883c
·
1 Parent(s): 87e4333

fixed video persistance

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -108,11 +108,14 @@ def process_history(history: list[dict]) -> list[dict]:
108
  )
109
  else:
110
  content = item["content"]
111
- content_buffer.append(
112
- {"type": "text", "text": content}
113
- if isinstance(content, str)
114
- else {"type": "image", "url": content[0]}
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})