forked from phoenix/litellm-mirror
fix(proxy_server.py): return [DONE] end of stream chunk
This commit is contained in:
parent
7822a8d421
commit
bf4c4426e5
1 changed files with 4 additions and 0 deletions
|
@ -913,6 +913,10 @@ async def async_data_generator(response, user_api_key_dict):
|
|||
yield f"data: {json.dumps(chunk.dict())}\n\n"
|
||||
except Exception as e:
|
||||
yield f"data: {str(e)}\n\n"
|
||||
|
||||
# Streaming is done, yield the [DONE] chunk
|
||||
done_message = "[DONE]"
|
||||
yield f"data: {done_message}\n\n"
|
||||
except Exception as e:
|
||||
yield f"data: {str(e)}\n\n"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue