Update api/utils.py
Browse files- api/utils.py +3 -3
api/utils.py
CHANGED
|
@@ -130,10 +130,10 @@ async def process_streaming_response(request: ChatRequest):
|
|
| 130 |
timeout=100,
|
| 131 |
) as response:
|
| 132 |
response.raise_for_status()
|
| 133 |
-
async for
|
| 134 |
timestamp = int(datetime.now().timestamp())
|
| 135 |
-
if
|
| 136 |
-
content =
|
| 137 |
if content.startswith("$@$v=undefined-rv1$@$"):
|
| 138 |
content = content[21:]
|
| 139 |
# Remove the blocked message if present
|
|
|
|
| 130 |
timeout=100,
|
| 131 |
) as response:
|
| 132 |
response.raise_for_status()
|
| 133 |
+
async for chunk in response.aiter_text():
|
| 134 |
timestamp = int(datetime.now().timestamp())
|
| 135 |
+
if chunk:
|
| 136 |
+
content = chunk
|
| 137 |
if content.startswith("$@$v=undefined-rv1$@$"):
|
| 138 |
content = content[21:]
|
| 139 |
# Remove the blocked message if present
|