The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
openai: fix allowed block types (#20636)
ccurme6d530481c104
diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.pyindex 7c132a3cb7..915557baa5 100644--- a/libs/partners/openai/langchain_openai/chat_models/base.py+++ b/libs/partners/openai/langchain_openai/chat_models/base.py@@ -154,7 +154,11 @@ def _format_message_content(content: Any) -> Any:# Remove unexpected block typesformatted_content = []for block in content:- if isinstance(block, dict) and "type" in block and block["type"] != "text":+ if (+ isinstance(block, dict)+ and "type" in block+ and block["type"] == "tool_use"+ ):continueelse:formatted_content.append(block)