Anthropic Python SDK v2.2.0 发布
原标题:v2.2.0
AI 摘要
Anthropic 发布 Python SDK v2.2.0,新增消息线程(message threads)API 支持,并新增按维度统计的用量与成本报告,同时将旧版报告标记为 legacy。该版本还修复了客户端 max_retries 错误提示、工具运行器在 append_messages() 与 set_messages_params() 回调中的历史与工具定义处理,以及 betas、user_profile_id、workspace_id 等字段保留问题。此外更新了依赖与文档说明。
正文节选
### Features * **api:** add support for message threads * **api:** add usage and cost reports by dimension, mark older reports legacy ### Bug Fixes * **client:** stop suggesting math.inf in the max_retries error message * **tools:** leave the tool runner's history to the caller after `append_messages()`, and keep the current reply out of the `set_messages_params()` callback * **tools:** keep running the tool runner's function tools when `set_messages_params()` gives `tools` as definitions, a