LangChain 于 2026-09-29 发布 langchain-anthropic==1.7.5 与 langchain-core==1.6.6:合并 #40882,为 Claude Sonnet 5.5 加入模型档案与能力发现;拒绝不支持的强制 tool_choice/thinking 组合;支持会话中途更换 system/tool;在流式与 replay 中保留 computer-toolset 命名空间、加密 advisor 块与 refusal 细节。非法 tool call 可按未强制结构化输出回退或显式 method="json_schema"。
核心要点速览 (Key Takeaways)
- ✓发版:langchain-anthropic==1.7.5 + langchain-core==1.6.6(2026-09-29)
- ✓核心 PR:fix(anthropic): Sonnet 5.5 compatibility #40882(merged 2026-09-29T13:05Z)
- ✓行为:校验 thinking/tool_choice;允许中途改 system/tool;流式保留 toolset 命名空间与 refusal 细节
- ✓结构化输出:不支持的强制 tool choice 走未强制回退,或显式
method="json_schema" - ✓安装:
pip install -U "langchain-anthropic==1.7.5" "langchain-core==1.6.6";文档 Anthropic provider
阅读完核心要点?进一步了解模型实力与实际开销
7 大权威镜像天梯跑分与 29+ 款主流编程套餐横向比价测算
相关资源与官方项目出处
免代理直达深度技术解析与实战评估
核心背景与行业痛点
Claude Code 等客户端已默认切到 Sonnet 5.5(见站内既有快讯),但 Python Agent 栈若仍停在旧版 langchain-anthropic,会出现:强制 tool_choice / thinking 组合被服务端拒;流式回合丢失 computer-toolset 命名空间或 refusal;中途换 system/tool 能力未刷新。开发者需要的是库级兼容层,而不是在业务代码里手写特例。
架构亮点与底层机制
#40882 为 Sonnet 5.5 增加模型档案与 models.dev 能力发现;拒绝不支持的强制 tool choice / thinking,必要时走既有未强制结构化输出回退或显式 method="json_schema"。支持会话中途更换 system/tool 并刷新能力数据。流式与 replay 路径保留 computer-toolset 命名空间、加密 advisor 块与 refusal 细节(含 core content-block 转换)。langchain-anthropic 另修非法 tool call 在 replay 时按 tool_use 序列化(见 1.7.5 notes);langchain-core==1.6.6 同步承接同一兼容面与 docstring 修复。
权威 Benchmark 与实测跑分对比
发行说明未附 SWE-bench 等模型榜单——这是集成库版本,不是新基座。请以你现有 Agent 评测集对比 1.7.4→1.7.5:Sonnet 5.5 下 tool loop 失败率、thinking 参数拒识率、流式 refusal 是否可观测。勿虚构竞技场分数。
开发者实战落地与开箱指南
pip install -U "langchain-anthropic==1.7.5" "langchain-core==1.6.6"(PyPI anthropic / core)。tool_choice;需要 JSON schema 时显式 method="json_schema"。
讨论与评论
0登录后即可参与深度讨论
与广大 AI 开发者、工程师交流评测心得与前沿洞察