test -self.received_finish_reason = response_obj["finish_reason"]

This commit is contained in:
Ishaan Jaff 2025-07-02 21:06:43 -07:00
parent f1777dbe3d
commit 4290e04e4f

View file

@ -1204,7 +1204,7 @@ class CustomStreamWrapper:
if response_obj is None:
return
completion_obj["content"] = response_obj["text"]
self.received_finish_reason = response_obj.get("finish_reason", None)
self.intermittent_finish_reason = response_obj.get("finish_reason", None)
if response_obj["is_finished"]:
if response_obj["finish_reason"] == "error":
raise Exception(
@ -1212,6 +1212,7 @@ class CustomStreamWrapper:
self.custom_llm_provider, response_obj
)
)
self.received_finish_reason = response_obj["finish_reason"]
if response_obj.get("original_chunk", None) is not None:
if hasattr(response_obj["original_chunk"], "id"):
model_response = self.set_model_id(