mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(streaming_handler.py): return model response on finished chunk
This commit is contained in:
parent
612d5a284d
commit
08b297230e
1 changed files with 1 additions and 2 deletions
|
|
@ -799,7 +799,6 @@ class CustomStreamWrapper:
|
|||
"provider_specific_fields" in response_obj
|
||||
and response_obj["provider_specific_fields"] is not None
|
||||
)
|
||||
or (getattr(model_response, "usage", None) is not None)
|
||||
):
|
||||
return True
|
||||
else:
|
||||
|
|
@ -899,7 +898,7 @@ class CustomStreamWrapper:
|
|||
return model_response
|
||||
|
||||
# Default - return StopIteration
|
||||
raise StopIteration
|
||||
return model_response
|
||||
# flush any remaining holding chunk
|
||||
if len(self.holding_chunk) > 0:
|
||||
if model_response.choices[0].delta.content is None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue