Skip to content

The agent engineering platform.

openai[patch]: fix azure oai stream check (#28048)

Bagatur139881b1080d
diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.py
index 8a1a63bbcd..9d6c199642 100644
--- a/libs/partners/openai/langchain_openai/chat_models/base.py
+++ b/libs/partners/openai/langchain_openai/chat_models/base.py
@@ -977,7 +977,7 @@ class BaseChatOpenAI(BaseChatModel):
# TODO: Add support for streaming with Pydantic response_format.
warnings.warn("Streaming with Pydantic response_format not yet supported.")
return False
- if self.model_name.startswith("o1"):
+ if self.model_name is not None and self.model_name.startswith("o1"):
# TODO: Add support for streaming with o1 once supported.
return False