We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fd3c2c commit 64ad289Copy full SHA for 64ad289
1 file changed
src/backend/server/request_handler.py
@@ -146,10 +146,10 @@ async def stream_generator():
146
return resp
147
else:
148
response = stub.chat_completion(request_data)
149
- response = next(response).decode()
+ content = (await anext(iterate_in_threadpool(response))).decode()
150
logger.debug(f"Non-stream response completed for {request_id}")
151
# response is a JSON string; parse to Python object before returning
152
- return JSONResponse(content=json.loads(response))
+ return JSONResponse(content=json.loads(content))
153
except Exception as e:
154
logger.exception(f"Error in _forward_request: {e}")
155
return JSONResponse(
0 commit comments