Spaces:
Running
Running
sunheycho
commited on
Commit
Β·
7fb5af7
1
Parent(s):
f51f445
Fix SSE message format causing frontend parsing issues
Browse files- Remove double wrapping of message objects in SSE stream
- Send message objects directly instead of wrapping in {'message': msg}
- Should fix white screen issue after analysis completion
- Frontend can now properly receive and display final results
api.py
CHANGED
@@ -1130,7 +1130,8 @@ def stream_product_comparison(session_id):
|
|
1130 |
print(f"[DEBUG] π€ Sending {len(new_messages)} new messages")
|
1131 |
for msg in new_messages:
|
1132 |
print(f"[DEBUG] π¨ Message: {msg}")
|
1133 |
-
|
|
|
1134 |
last_message_index = len(messages)
|
1135 |
|
1136 |
# Send current status
|
|
|
1130 |
print(f"[DEBUG] π€ Sending {len(new_messages)} new messages")
|
1131 |
for msg in new_messages:
|
1132 |
print(f"[DEBUG] π¨ Message: {msg}")
|
1133 |
+
# msg is already a dict with message, agent, timestamp
|
1134 |
+
yield f"data: {json.dumps(msg)}\n\n"
|
1135 |
last_message_index = len(messages)
|
1136 |
|
1137 |
# Send current status
|