mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(proxy_server.py): don't return None objects
This commit is contained in:
parent
b63beaead0
commit
fa53a47951
1 changed files with 2 additions and 1 deletions
|
@ -2116,8 +2116,9 @@ async def async_data_generator(response, user_api_key_dict):
|
|||
start_time = time.time()
|
||||
async for chunk in response:
|
||||
verbose_proxy_logger.debug(f"returned chunk: {chunk}")
|
||||
assert isinstance(chunk, litellm.ModelResponse)
|
||||
try:
|
||||
yield f"data: {json.dumps(chunk.dict())}\n\n"
|
||||
yield f"data: {json.dumps(chunk.model_dump(exclude_none=True))}\n\n"
|
||||
except Exception as e:
|
||||
yield f"data: {str(e)}\n\n"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue