Closed yuanjie-ai closed 1 month ago
if request.stream:
chunks = await Completions(api_key).create(request)
chunks = create_chat_completion_chunk(chunks)
return EventSourceResponse(chunks)
How to avoid such mistakes?
EventSourceResponse(chunks, ping=100000)?
@yuanjie-ai , unfortunately I do not understand your question.
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 289, in call await wrap(partial(self.listen_for_disconnect, receive)) File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 278, in wrap await func() File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 228, in listen_for_disconnect message = await receive() File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 534, in receive await self.message_event.wait() File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait await fut asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f8d169450c0
During handling of the above exception, another exception occurred:
+------------------------------------