The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
openai[patch]: perform judgment processing on chat model streaming delta (#18983)
HuangZiye1f10a697e48
diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.pyindex f11c13ce96..90b7c9c8fd 100644--- a/libs/partners/openai/langchain_openai/chat_models/base.py+++ b/libs/partners/openai/langchain_openai/chat_models/base.py@@ -463,6 +463,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)@@ -557,6 +559,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)