该版本主要扩展了 API 对 Managed Agents 的支持,新增了模型努力程度控制、初始会话事件以及线程增量流式处理能力。
新增 API 支持:Managed Agents 模型努力程度:现在可以在请求中指定 Managed Agents 的模型努力程度(model effort),用于控制模型在任务上的推理或计算资源投入程度。
新增 API 支持:初始会话事件(initial session events):在创建或启动会话时,现在可以获取初始会话事件,便于在会话生命周期早期进行事件驱动的逻辑处理。
新增 API 支持:线程增量流式处理(threads delta streaming):针对线程(threads)的更新,引入了增量流式处理模式,允许客户端以流式方式接收线程状态的增量变化,减少全量轮询开销。
▸ Release Notes 英文原文(377 字符)
## 0.118.0 (2026-07-22)
Full Changelog: [v0.117.1...v0.118.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.117.1...v0.118.0)
### Features
* **api:** add support for Managed Agents model effort, initial session events, and threads delta streaming ([712bc6f](https://github.com/anthropics/anthropic-sdk-python/commit/712bc6f5e07ca7607e13f24fba4eea57c2e73478))
▸ 主项目介绍 · anthropics/anthropic-sdk-python
▸ README 原文(同步于 2026-07-19 13:24)
# Claude SDK for Python
[](https://pypi.org/project/anthropic/)
The Claude SDK for Python provides access to the [Claude API](https://docs.anthropic.com/en/api/) from Python applications.
## Documentation
Full documentation is available at **[platform.claude.com/docs/en/api/sdks/python](https://platform.claude.com/docs/en/api/sdks/python)**.
## Installation
```sh
pip install anthropic
```
## Getting started
```python
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get("ANTHROPIC_API_KEY"), # This is the default and can be omitted
)
message = client.messages.create(
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Hello, Claude",
}
],
model="claude-opus-4-6",
)
print(message.content)
```
## Requirements
Python 3.9+
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.