我们已发布 Python SDK v1.0。SDK 的 HTTP 层从 httpx 迁移到 httpx2,这是一个持续维护、API 兼容的分支:从 httpx2 构建自定义的 http_client、Timeout 和 transport 对象(DefaultHttpxClient 辅助函数保持不变),如果你依赖会修补 httpx 的追踪或模拟库,请在启动时调用 httpx2.alias_httpx()。v1.0 要求 Python 3.10 或更高版本,并移除了长期弃用的接口,包括旧版 Text Completions API、Messages 方法上的 temperature、top_p 和 top_k 参数,以及工具运行器的客户端 compaction_control。在异步客户端上,.with_raw_response 的结果现在需要 await response.parse(),并且 AnthropicBedrock 现在在未配置 AWS 区域时会抛出错误,而不是默认使用 us-east-1。请参阅 v1 迁移指南,了解每项变更的前后代码片段。计算机使用和浏览器使用工具集(computer_toolset_20260801 和 browser_toolset_20260801)现已在 Google Cloud 上适用于 Claude Fable 5、Claude Mythos 5、Claude Opus 5、Claude Sonnet 5 和 Claude Opus 4.8。请求使用与 Claude API 上相同的 tools 条目。
We’ve released v1.0 of the Python SDK. The SDK’s HTTP layer moves from httpx to httpx2, a maintained, API-compatible fork: build custom http_client, Timeout, and transport objects from httpx2 (the DefaultHttpxClient helpers are unchanged), and call httpx2.alias_httpx() at startup if you rely on tracing or mocking libraries that patch httpx. v1.0 requires Python 3.10 or later and removes long-deprecated surface, including the legacy Text Completions API, the temperature, top_p, and top_k parameters on Messages methods, and the tool runner’s client-side compaction_control. On the async client, .with_raw_response results now need await response.parse(), and AnthropicBedrock now raises an error when no AWS region is configured instead of defaulting to us-east-1. See the v1 migration guide for every change with before-and-after snippets. The computer use and browser use toolsets (computer_toolset_20260801 and browser_toolset_20260801) are now available on Google Cloud for Claude Fable 5, Claude Mythos 5, Claude Opus 5, Claude Sonnet 5, and Claude Opus 4.8. Requests use the same tools entries as on the Claude API.
本文内容采集自官方网站,排版和翻译可能与原页面存在差异。
阅读官方全文