Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -66,10 +66,10 @@ def generate_search(query: str, stream: bool = True) -> str:
|
|
66 |
if value.startswith("data: "):
|
67 |
try:
|
68 |
json_modified_value = json.loads(value[6:]) # Remove 'data: ' prefix
|
69 |
-
content = json_modified_value
|
70 |
# Include everything, even if it's just whitespace
|
71 |
if stream:
|
72 |
-
yield f"data: {
|
73 |
streaming_text += content
|
74 |
except json.JSONDecodeError:
|
75 |
continue # Skip lines that are not valid JSON
|
|
|
66 |
if value.startswith("data: "):
|
67 |
try:
|
68 |
json_modified_value = json.loads(value[6:]) # Remove 'data: ' prefix
|
69 |
+
content = json_modified_value
|
70 |
# Include everything, even if it's just whitespace
|
71 |
if stream:
|
72 |
+
yield f"data: {content}\n"
|
73 |
streaming_text += content
|
74 |
except json.JSONDecodeError:
|
75 |
continue # Skip lines that are not valid JSON
|