feat(bedrock): add prompt cache TTL support#4581
Open
imdigitalashish wants to merge 4 commits intopydantic:mainfrom
Open
feat(bedrock): add prompt cache TTL support#4581imdigitalashish wants to merge 4 commits intopydantic:mainfrom
imdigitalashish wants to merge 4 commits intopydantic:mainfrom
Conversation
Add configurable TTL ('5m' or '1h') for Bedrock prompt caching.
Previously all cache settings were boolean-only. Now
`bedrock_cache_instructions`, `bedrock_cache_tool_definitions`, and
`bedrock_cache_messages` accept `bool | Literal['5m', '1h']`, and
`CachePoint(ttl=...)` is forwarded to the Bedrock API.
Closes pydantic#4096
71753fd to
876615d
Compare
|
I'd love to see this merged - this would directly help reduce costs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add configurable TTL ('5m' or '1h') for Bedrock prompt caching. Previously all cache settings were boolean-only. Now
bedrock_cache_instructions,bedrock_cache_tool_definitions, andbedrock_cache_messagesacceptbool | Literal['5m', '1h'], andCachePoint(ttl=...)is forwarded to the Bedrock API.Closes #4096
Pre-Review Checklist
make formatandmake typecheck.Pre-Merge Checklist
Summary by cubic
Adds TTL support to Amazon Bedrock prompt caching so you can set '5m' or '1h' instead of only on/off. TTL applies to system instructions, tool definitions, the last user message, and manual CachePoint. Closes #4096.
New Features
Dependencies
Written for commit 89018eb. Summary will update on new commits.