The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: set tool name for tongyi&qianfan llm (#22889)
mackong11483b0fb8f4
diff --git a/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py b/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.pyindex 3b75ab2524..0a8e53e2a6 100644--- a/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py+++ b/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py@@ -65,7 +65,7 @@ def convert_message_to_dict(message: BaseMessage) -> dict:message_dict = {"role": "function","content": message.content,- "name": message.name,+ "name": message.name or message.additional_kwargs.get("name"),}else:raise TypeError(f"Got unknown type {message}")diff --git a/libs/community/langchain_community/chat_models/tongyi.py b/libs/community/langchain_community/chat_models/tongyi.pyindex 90dc84c239..939dd620d5 100644--- a/libs/community/langchain_community/chat_models/tongyi.py+++ b/libs/community/langchain_community/chat_models/tongyi.py@@ -201,7 +201,7 @@ def convert_message_to_dict(message: BaseMessage) -> dict:"role": "tool","tool_call_id": message.tool_call_id,"content": message.content,- "name": message.name,+ "name": message.name or message.additional_kwargs.get("name"),}elif isinstance(message, FunctionMessage):message_dict = {