Niansuh commited on
Commit
7fd2af4
·
verified ·
1 Parent(s): 27288d3

Update api/utils.py

Browse files
Files changed (1) hide show
  1. 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 line in response.aiter_lines():
134
  timestamp = int(datetime.now().timestamp())
135
- if line:
136
- content = line
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