mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
feat(anthropic): support mcp_toolset in bind_tools (#34284)
This commit is contained in:
@@ -154,6 +154,7 @@ def _is_builtin_tool(tool: Any) -> bool:
|
|||||||
"web_search_",
|
"web_search_",
|
||||||
"web_fetch_",
|
"web_fetch_",
|
||||||
"code_execution_",
|
"code_execution_",
|
||||||
|
"mcp_toolset",
|
||||||
"memory_",
|
"memory_",
|
||||||
"tool_search_",
|
"tool_search_",
|
||||||
]
|
]
|
||||||
|
|||||||
Binary file not shown.
@@ -1801,18 +1801,15 @@ def test_remote_mcp(output_version: Literal["v0", "v1"]) -> None:
|
|||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://mcp.deepwiki.com/mcp",
|
"url": "https://mcp.deepwiki.com/mcp",
|
||||||
"name": "deepwiki",
|
"name": "deepwiki",
|
||||||
"tool_configuration": {"enabled": True, "allowed_tools": ["ask_question"]},
|
|
||||||
"authorization_token": "PLACEHOLDER",
|
"authorization_token": "PLACEHOLDER",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
llm = ChatAnthropic(
|
llm = ChatAnthropic(
|
||||||
model="claude-sonnet-4-5-20250929", # type: ignore[call-arg]
|
model="claude-sonnet-4-5-20250929", # type: ignore[call-arg]
|
||||||
betas=["mcp-client-2025-04-04"],
|
|
||||||
mcp_servers=mcp_servers,
|
mcp_servers=mcp_servers,
|
||||||
max_tokens=10_000, # type: ignore[call-arg]
|
|
||||||
output_version=output_version,
|
output_version=output_version,
|
||||||
)
|
).bind_tools([{"type": "mcp_toolset", "mcp_server_name": "deepwiki"}])
|
||||||
|
|
||||||
input_message = {
|
input_message = {
|
||||||
"role": "user",
|
"role": "user",
|
||||||
|
|||||||
Reference in New Issue
Block a user