LangChain · Class
AnthropicPromptCachingMiddleware
AnthropicPromptCachingMiddleware caches reusable prompt prefixes for Anthropic models. It can reduce repeated processing, but it does not persist conversation history.
Last updated
- Since
- v1.6
Syntax
AnthropicPromptCachingMiddleware(type="ephemeral", ttl="5m", min_messages_to_cache=0, unsupported_model_behavior="warn")In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
ChatAnthropiccreate_agentMemorySavercache_control