Spaces:
Running
Running
axeronis commited on
Commit ·
bca5a0b
1
Parent(s): f1ad673
Fix: Images disappear after page refresh
Browse filesRoot cause: get_lead_conversation API didn't return media fields
- media_url, media_type, media_name were missing from serialization
- Images appeared via WebSocket but gone after refresh (API fetch)
Fix: Added all three media fields to message dict in response
Now images/voice persist correctly after page refresh
- backend/app/api/leads.py +3 -0
backend/app/api/leads.py
CHANGED
|
@@ -230,6 +230,9 @@ async def get_lead_conversation(
|
|
| 230 |
"sender_type": msg.sender_type,
|
| 231 |
"content": msg.content,
|
| 232 |
"created_at": msg.created_at.isoformat(),
|
|
|
|
|
|
|
|
|
|
| 233 |
"tokens": {
|
| 234 |
"prompt": msg.prompt_tokens,
|
| 235 |
"completion": msg.completion_tokens
|
|
|
|
| 230 |
"sender_type": msg.sender_type,
|
| 231 |
"content": msg.content,
|
| 232 |
"created_at": msg.created_at.isoformat(),
|
| 233 |
+
"media_url": msg.media_url,
|
| 234 |
+
"media_type": msg.media_type,
|
| 235 |
+
"media_name": msg.media_name,
|
| 236 |
"tokens": {
|
| 237 |
"prompt": msg.prompt_tokens,
|
| 238 |
"completion": msg.completion_tokens
|