Agent DailyAgent Daily
releaseintermediate

[Release] langchain-ai/langchain langchain-anthropic==1.4.0: langchain-anthropic==1.4.0

By github-actions[bot]github
View original on github

langchain-anthropic version 1.4.0 introduces prompt caching middleware for system messages and tool definitions, delegates cache_control parameters to Anthropic's top-level configuration, and includes dependency updates. This release enhances caching efficiency for Anthropic integrations in LangChain by providing explicit control over cached content and streamlining parameter handling.

Key Points

  • New AnthropicPromptCachingMiddleware enables explicit caching of system messages and tool definitions to reduce API costs
  • cache_control kwarg is now delegated to Anthropic's top-level parameters for cleaner API integration
  • Model profile data refreshed to ensure compatibility with latest Anthropic models
  • Dependency upgrade: orjson bumped from 3.11.5 to 3.11.6 for improved performance and security
  • Prompt caching middleware allows developers to optimize token usage by caching frequently-used system prompts and tool schemas
  • Simplified parameter passing reduces boilerplate code when configuring Anthropic cache settings

Found this useful? Add it to a playbook for a step-by-step implementation guide.

Workflow Diagram

Start Process
Step A
Step B
Step C
Complete
Quality

Concepts