ReqLLM. Providers. AmazonBedrock. PromptCache
(ReqLLM v1.26.0)
View Source
Prompt caching options shared by the Amazon Bedrock formatters.
Resolves the prompt_cache, prompt_cache_ttl and cache_messages provider
options, builds Converse cachePoint blocks and bridges the options to the
keys consumed by ReqLLM.Providers.Anthropic.
See https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
Summary
Functions
Place automatic checkpoints after the tools, the system prompt and the
cache_messages position of an encoded Converse request, then check that no
1h checkpoint follows a 5m one.
Build a Converse cachePoint block. ttl is omitted when nil.
True for a Converse cachePoint block.
Return the cachePoint block declared by the cache_control metadata of a
ContentPart or a Message, or nil. Only the ttl is carried over.
Resolve the prompt cache options into a config map.
Rewrite the generic options into the anthropic_* keys read by the
Anthropic provider's prompt caching helper.
Types
Functions
Place automatic checkpoints after the tools, the system prompt and the
cache_messages position of an encoded Converse request, then check that no
1h checkpoint follows a 5m one.
Build a Converse cachePoint block. ttl is omitted when nil.
True for a Converse cachePoint block.
Return the cachePoint block declared by the cache_control metadata of a
ContentPart or a Message, or nil. Only the ttl is carried over.
Resolve the prompt cache options into a config map.
Top-level options win over provider_options, and the generic keys win over
their anthropic_* aliases.
Rewrite the generic options into the anthropic_* keys read by the
Anthropic provider's prompt caching helper.