The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: delta in openai choice can be None, creates handler for that (#25954)
Tom Daniel Grande0207dc1431c2
diff --git a/libs/community/langchain_community/chat_models/openai.py b/libs/community/langchain_community/chat_models/openai.pyindex a8d197d3be..54326d0acc 100644--- a/libs/community/langchain_community/chat_models/openai.py+++ b/libs/community/langchain_community/chat_models/openai.py@@ -403,6 +403,8 @@ class ChatOpenAI(BaseChatModel):if len(chunk["choices"]) == 0:continuechoice = chunk["choices"][0]+ if choice["delta"] is None:+ continuechunk = _convert_delta_to_message_chunk(choice["delta"], default_chunk_class)@@ -495,6 +497,8 @@ class ChatOpenAI(BaseChatModel):if len(chunk["choices"]) == 0:continuechoice = chunk["choices"][0]+ if choice["delta"] is None:+ continuechunk = _convert_delta_to_message_chunk(choice["delta"], default_chunk_class)