Anthropic (Claude) chat models.
See the LangChain docs for ChatAnthropic
for tutorials, feature walkthroughs, and examples.
See the Claude Platform docs for a list of the latest models, their capabilities, and pricing.
Prompt Caching Middleware.
Optimizes API usage by caching conversation prefixes for Anthropic models.
Requires both langchain and langchain-anthropic packages to be installed.
The middleware tags stable agent content and passes cache_control through
model_settings:
cache_control so static system prompt content is cached.cache_control. Because
tool definitions are sent as one contiguous block, a single trailing
breakpoint caches the entire tool set across turns.model_settings: Passes cache_control to the chat model. The chat
model/provider then applies the correct message-tail and
provider-specific behavior at request time.Learn more about Anthropic prompt caching here.
Anthropic prompt caching middleware.
Requires:
langchain: For agent middleware frameworklangchain-anthropic: For ChatAnthropic model (already a dependency)