mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
fix(streaming): read the chunk's finish reason for the sticky flag
This commit is contained in:
parent
aec3fbaeca
commit
04f3765e1a
1 changed files with 1 additions and 1 deletions
|
|
@ -1534,7 +1534,7 @@ class CustomStreamWrapper:
|
|||
return _ProviderChunkEarlyReturn(None)
|
||||
completion_obj["content"] = response_obj["text"]
|
||||
self.intermittent_finish_reason = response_obj.get("finish_reason", None)
|
||||
self.received_any_finish_reason |= self.intermittent_finish_reason is not None
|
||||
self.received_any_finish_reason |= response_obj["finish_reason"] is not None
|
||||
if response_obj["is_finished"]:
|
||||
if response_obj["finish_reason"] == "error":
|
||||
raise Exception(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue