anthropics / anthropics/claude-agent-sdk-python
[FEATURE] Prompt Caching Support in Claude Agent SDK
- Linguagem predominante
- Python
- Estrelas
- 8.1k
- Forks
- 1.3k
- Merge médio
- 2d 31min
- PRs com merge (30d)
- 1
Descrição
# [Feature Request] Support Bedrock Prompt Caching in Claude Agent SDK
## Description
I am currently using the **Claude Agent SDK** with **Amazon Bedrock** as the model provider. I am unable to enable **Prompt Caching** via the SDK because the current `ClaudeAgentOptions` (and the underlying Bedrock provider) do not support the injection of cache control metadata into the message payload.
To leverage Bedrock's prompt caching, the payload must allow for `cache_control` or `cachePoint` blocks within the messages or system prompts.
## Proposed Change
Update the `ClaudeAgentOptions` and the Bedrock model provider logic to support the following structures in the request payload:
**For Ephemeral Caching:**
```json
"cache_control": {
"type": "ephemeral"
}
```
**For Cache Points:**
```json
"cachePoint": {
"type": "default"
}
```
---
## 1. Documentation Links
* **Main Guide**: [Amazon Bedrock Prompt Caching User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html)
* **API Reference**: [Amazon Bedrock Runtime - InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html)
* **Model Specifics**: [Anthropic Claude Models on Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html)
---
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.