diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.py index 8a1a63bbcdbfb..9d6c1996423d8 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 @@ def _should_stream( # 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