Skip to content

feat(anthropic): add support for prompt caching with fix - #4100

Closed
Claudio-code wants to merge 6 commits into
spring-projects:mainfrom
Claudio-code:gh-1413-pr-2-fix
Closed

feat(anthropic): add support for prompt caching with fix#4100
Claudio-code wants to merge 6 commits into
spring-projects:mainfrom
Claudio-code:gh-1413-pr-2-fix

Conversation

@Claudio-code

@Claudio-code Claudio-code commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Claudio-code and others added 6 commits April 8, 2025 11:35
Implements Anthropic's prompt caching feature to improve token efficiency.

- Adds cache control support in AnthropicApi and AnthropicChatModel
- Creates AnthropicCacheType enum with EPHEMERAL cache type
- Extends AbstractMessage and UserMessage to support cache parameters
- Updates Usage tracking to include cache-related token metrics
- Adds integration test to verify prompt caching functionality

This implementation follows Anthropic's prompt caching API (beta-2024-07-31) which allows
for more efficient token usage by caching frequently used prompts.
Signed-off-by: Claudio Silva Junior <42524939+Claudio-code@users.noreply.github.com>
@sobychacko

Copy link
Copy Markdown
Contributor

Could you take care of the DCO signing on the commit? https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring. Thanks!

@sobychacko

Copy link
Copy Markdown
Contributor

@Claudio-code Checking in again - could you please update your commit with DCO signing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants