#文档变更分析
### 1. 总体摘要
本次更新对 37 个页面进行了全面修订,核心在于大幅扩充了 **Go、Java、PHP 和 Ruby** 的官方 SDK 代码示例,覆盖了从基础消息交互到高级特性(如扩展思考、Prompt Caching、文件处理、Bedrock/Vertex 集成)的几乎所有功能。此外,文档引入了新的 `claude-haiku-4-5` 模型,明确了 Prompt Caching 的定价细节,并将 Java SDK 版本更新至 `2.15.0`。
### 2. 关键变更主题
* **多语言 SDK 生态大爆发**:几乎所有功能页面(流式传输、视觉、PDF、扩展思考、批处理、结构化输出等)都新增了 Go、Java、PHP 和 Ruby 的完整代码示例,标志着对这些语言的一等公民支持。
* **模型阵容更新与清理**:引入了新的 `claude-haiku-4-5`(最快且具备接近前沿智能的模型),更新了 Sonnet 4.6 等模型的描述,并移除了旧版别名(如 `claude-3-7-sonnet-latest`),简化了模型选择逻辑。
* **Java SDK 重大更新**:Java SDK 版本统一更新至 `2.15.0`,代码示例采用了新的构建器模式,特别是结构化输出使用了新的 `StructuredMessage` 类,且文件和 Beta 功能相关的包路径有所调整。
* **云平台支持扩展**:移除了关于 PHP SDK 不支持 Amazon Bedrock 和 Google Vertex AI 的说明,新增了 PHP 在这两个平台上的集成示例。
* **安全与配置优化**:细化了沙箱网络控制的文档,明确了 `allowManagedDomainsOnly` 在自动阻止非允许域方面的行为;完善了 Prompt Caching 的定价计算逻辑。
### 3. 影响程度:高
**理由**:
* **开发者受众扩大**:通过提供 Go、Java、PHP 和 Ruby 的完整示例,大幅降低了非 Python/TypeScript 技术栈开发者的接入门槛。
* **新模型引入**:`claude-haiku-4-5` 的引入为低延迟、高吞吐量场景提供了新选项,直接影响架构决策。
* **SDK 版本升级**:Java SDK 的频繁版本更新(2.11 -> 2.15)意味着开发者需要跟进以获得最新功能和修复。
* **废弃模型**:清理旧模型别名可能要求开发者更新硬编码在代码中的模型名称。
### 4. 开发者行动项
* **升级 Java SDK**:将依赖从 `2.11.1` 或 `2.13.0` 更新至 `2.15.0`,并参考最新示例调整代码结构(特别是结构化输出和文件上传部分)。
* **评估 Haiku 4.5**:在需要极速响应或成本敏感的场景中,测试新的 `claude-haiku-4-5` 模型,确认其是否符合“接近前沿智能”的预期。
* **复核 Prompt Caching 成本**:阅读新的“Prompt caching”定价章节,利用新的倍率说明(5分钟写入 1.25x,1小时写入 2x,读取 0.1x)重新计算缓存策略的 ROI。
* **PHP 开发者集成云服务**:如果您使用 PHP,现在可以尝试直接通过官方 SDK 接入 Amazon Bedrock 或 Google Vertex AI。
* **检查沙箱配置**:如果在使用受限沙箱环境,请检查 `allowManagedDomainsOnly` 设置,确保其行为符合您的安全预期(即自动拦截未经批准的域请求)。
💭 Model Reasoning
1. **Understand the Goal**: The user wants a concise, insightful batch analysis of documentation changes (37 pages total, though I only see diffs for a subset) in markdown format. The focus is on "what matters to developers." The response must be in Chinese.
2. **Analyze the Diffs**:
* **`sandboxing.md` (+1/-1):**
* *Change*: Clarified "User confirmation" for new domain requests. Added a note about `allowManagedDomainsOnly` blocking non-allowed domains automatically.
* *Impact*: Security/Configuration. Developers need to know about the automatic blocking setting.
* **`settings.md` (+17/-17):**
* *Change*: The diff seems truncated in the preview, but the table keys for sandboxing settings are reformatted/updated. Key visible keys: `enabled`, `autoAllowBashIfSandboxed`, `excludedCommands`, `allowUnsandboxedCommands`, filesystem/network settings, etc.
* *Impact*: Configuration management. Developers use this to control environment behavior.
* **`get-started.md` (+4/-2):**
* *Change*: Updated Java SDK version from `1.0.0` to `2.15.0`. Added `nocheck` to code block.
* *Impact*: Dependency update. Critical for new users getting the correct version.
* **`about-claude/models/migration-guide.md` (+179/-0):**
* *Change*: Added extensive code examples for Go, Java, PHP, and Ruby.
* *Content*: Examples cover "Adaptive Thinking" (Opus 4.6), "Low Effort" (Sonnet 4.6), and "Interleaved Thinking" (Sonnet 4.6).
* *Impact*: Multi-language support. Major expansion for non-Python/TS/C# developers.
* **`about-claude/pricing.md` (+20/-10):**
* *Change*: Reorganized "Prompt caching" section. Added a specific section explaining the multipliers (1.25x for 5-min write, 2x for 1-hour write, 0.1x read).
* *Impact*: Cost optimization. Developers can now better calculate costs.
* **`api/messages.md` (+41/-91):**
* *Change*: Updated model list and descriptions. Removed older models (e.g., claude-3-7-sonnet-latest, claude-3-opus-latest). Added "claude-haiku-4-5" (Fastest model with near-frontier intelligence). Updated model descriptions (e.g., Sonnet 4.6 is "Best combination of speed and intelligence").
* *Impact*: Model selection. New "Haiku 4.5" is a key highlight.
* **`api/messages/count_tokens.md` (+8/-18):**
* *Change*: Same model list update as `api/messages.md`.
* **`api/messages/batches/create.md` (+8/-18):**
* *Change*: Same model list update as `api/messages.md`.
* **`api/client-sdks.md` (+27/-9):**
* *Change*: Updated Java SDK version to `2.15.0`. Added Go, Java, PHP, Ruby example code for basic usage and beta features.
* *Impact*: Onboarding and version consistency.
* **`build-with-claude/vision.md` (+21/-10):**
* *Change*: Added Go, Java, PHP examples for downloading/encoding images and using them in vision requests. Updated Java SDK imports (beta packages).
* *Impact*: Multi-language implementation of vision features.
* **`build-with-claude/pdf-support.md` (+34/-20):**
* *Change*: Added Go, Java, PHP examples for PDF support (URL, Base64, Files API). Updated Java imports to beta packages.
* *Impact*: Multi-language document processing support.
* **`build-with-claude/extended-thinking.md` (+598/-0):**
* *Change*: Added huge amounts of Go, Java, PHP, Ruby code examples for extended thinking (both non-streaming and streaming).
* *Impact*: Major language expansion for a core feature.
* **`build-with-claude/streaming.md` (+208/-10):**
* *Change*: Added Go, Java, PHP, Ruby streaming examples. Added mentions of PHP SDK streaming support.
* *Impact*: Multi-language support for streaming.
* **`build-with-claude/prompt-caching.md` (+221/-1):**
* *Change*: Added Go, Java, PHP, Ruby examples for prompt caching (automatic, explicit, multi-turn, tools, system blocks).
* *Impact*: Multi-language cost optimization patterns.
* **`build-with-claude/batch-processing.md` (+165/-22):**
* *Change*: Updated C# and Java examples. Added Go, Java, PHP, Ruby examples for creating batches, polling, listing, and retrieving results.
* *Impact*: Multi-language support for batch processing.
* **`build-with-claude/context-windows.md` (+59/-0):**
* *Change*: Added Go, Java, PHP, Ruby examples for using 1M context windows.
* *Impact*: Context window usage in more languages.
* **`build-with-claude/context-editing.md` (+327/-4):**
* *Change*: Added Go, Java, PHP, Ruby examples for context management (clearing tool uses).
* *Impact*: Advanced context management patterns.
* **`build-with-claude/citations.md` (+1/-1):**
* *Change*: Reorganized code blocks (Bash moved up). Added `cache_control` example.
* *Impact*: Minor code organization.
* **`build-with-claude/search-results.md` (+293/-1):**
* *Change*: Added Go, Java examples for search results.
* *Impact*: Implementation of RAG/Search features in Go/Java.
* **`build-with-claude/structured-outputs.md` (+364/-25):**
* *Change*: Added Go, Java, PHP, Ruby examples. Updated Java examples to use new structured output classes (`StructuredMessage`).
* *Impact*: Enhanced type safety and data extraction in multiple languages.
* **`build-with-claude/effort.md` (+62/-1):**
* *Change*: Added Go, Java, PHP, Ruby examples for `output_config.effort`.
* *Impact*: Performance tuning in new languages.
* **`build-with-claude/files.md` (+157/-40):**
* *Change*: Added Go, Java, PHP, Ruby examples for Files API. Updated Java imports.
* *Impact*: File handling across ecosystems.
* **`build-with-claude/working-with-messages.md` (+215/-0):**
* *Change*: Added Go, Java, PHP, Ruby examples for basic messages, multi-turn conversations, and prefilling.
* *Impact*: Core API usage in new languages.
* **`build-with-claude/claude-on-amazon-bedrock.md` (+100/-10):**
* *Change*: Updated Java Bedrock SDK version. Removed "PHP not supported" note (implied support added). Added PHP, Ruby, Go, Java Bedrock examples.
* *Impact*: Platform support expansion.
* **`build-with-claude/claude-on-vertex-ai.md` (+50/-12):**
* *Change*: Updated Java Vertex SDK version. Removed "PHP not supported" note. Added PHP, Ruby, Go, Java Vertex examples.
* *Impact*: Platform support expansion.
3. **Synthesize Key Themes**:
* **Massive Multi-Language SDK Expansion**: The dominant theme is the addition of Go, Java, PHP, and Ruby code examples across almost every feature (Streaming, Vision, PDF, Extended Thinking, Prompt Caching, Batch, Files, Structured Outputs, Bedrock, Vertex). Previously Python/TS/C# focused.
* **Java SDK 2.15.0 Update**: Consistent version bump and usage of new builder patterns/beta classes (e.g., `StructuredMessage`, `BetaFileMetadata`).
* **Model Updates**: Introduction of `claude-haiku-4-5` (Fastest, near-frontier), refined descriptions for Sonnet 4.6, removal of legacy model aliases (`claude-3-...-latest`).
* **Platform Support Confirmation**: PHP now supports Bedrock and Vertex AI.
* **Sandboxing Refinements**: Better documentation on network controls (`allowManagedDomainsOnly`).
* **Pricing Clarity**: Better breakdown of Prompt Caching multipliers.
4. **Determine Impact Level**:
* *High*: This is a significant documentation overhaul. The addition of full support (with examples) for Go, Java, PHP, and Ruby makes the platform much more accessible to enterprise and diverse backend teams. The model changes (Haiku 4.5) affect performance characteristics.
5. **Draft Action Items**:
* Update Java SDK dependency to 2.15.0.
* Try new `claude-haiku-4-5` for low-latency needs.
* Review prompt caching pricing math based on the new detailed section.
* If using PHP, explore newly supported Bedrock/Vertex integrations.
* Check sandboxing settings if network restrictions are strict (`allowManagedDomainsOnly`).
6. **Translate to Chinese**:
* *Summary*: 本次更新涵盖了37个页面的文档变更,核心在于大幅扩展了 Go、Java、PHP 和 Ruby SDK 的代码示例,涵盖了流式传输、视觉分析、PDF 解析、扩展思考等关键功能。同时,引入了 `claude-haiku-4-5` 模型并更新了 Java SDK 版本。
* *Themes*:
* 多语言 SDK 扩张.
* 模型更新.
* 平台支持.
* 安全与配置.
* 成本透明化.
* *Impact*: High. (Reasoning: Major SDK expansion broadens developer base; new model options affect performance/latency; deprecated models require attention).
* *Action Items*:
* Java 用户升级至 2.15.0.
* 评估 Haiku 4.5.
* 查看 Prompt Caching 定价.
* PHP 用户尝试 Bedrock/Vertex.
* 检查沙箱网络设置.
7. **Refine and Format**: Ensure markdown structure is correct and tone is professional.
* *Self-Correction during drafting*: I noticed PHP Bedrock/Vertex support was previously noted as "not supported" and is now supported. This is a key "Developer Matter" point.
* *Self-Correction*: The Java Structured Outputs examples look significantly updated (new classes). Mention this specifically.
8. **Final Output Generation**: (Matches the provided Chinese response).