Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,12 @@ def handle_vision_call(msg, image_history):
|
|
| 37 |
"role": "user",
|
| 38 |
"content": [
|
| 39 |
{"type": "text", "text": msg.content},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
],
|
| 41 |
}
|
| 42 |
)
|
|
@@ -97,7 +103,6 @@ async def on_message(msg: cl.Message):
|
|
| 97 |
|
| 98 |
if stream:
|
| 99 |
await process_stream(stream, msg=stream_msg)
|
| 100 |
-
image_history.append({"role": "system", "content": stream_msg.content})
|
| 101 |
message_history.append({"role": "system", "content": stream_msg.content})
|
| 102 |
|
| 103 |
-
return stream_msg.content
|
|
|
|
| 37 |
"role": "user",
|
| 38 |
"content": [
|
| 39 |
{"type": "text", "text": msg.content},
|
| 40 |
+
{
|
| 41 |
+
"type": "image_url",
|
| 42 |
+
"image_url": {
|
| 43 |
+
"url": f"data:image/jpeg;base64,{image_base64}"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
],
|
| 47 |
}
|
| 48 |
)
|
|
|
|
| 103 |
|
| 104 |
if stream:
|
| 105 |
await process_stream(stream, msg=stream_msg)
|
|
|
|
| 106 |
message_history.append({"role": "system", "content": stream_msg.content})
|
| 107 |
|
| 108 |
+
return stream_msg.content
|