Skip to content

Conversation

@Wh1isper
Copy link
Contributor

@Wh1isper Wh1isper commented Dec 2, 2025

In #3450 I introduced ttl to CachePoint and Anthropic caching model settings but Bedrock doesn't support the explicit TTL parameter in cache_control. This adds a _build_cache_control() method that automatically detects AsyncAnthropicBedrock clients and omits the TTL field. (sorry guys)

  • Add _build_cache_control() to handle client-specific cache_control
  • Convert _add_cache_control_to_last_param to instance method
  • Update documentation for CachePoint and model settings
  • Add comprehensive tests for Bedrock TTL omission

closes #3615

Bedrock doesn't support the explicit TTL parameter in cache_control. This adds a _build_cache_control() method that automatically detects AsyncAnthropicBedrock clients and omits the TTL field. - Add _build_cache_control() to handle client-specific cache_control - Convert _add_cache_control_to_last_param to instance method - Update documentation for CachePoint and model settings - Add comprehensive tests for Bedrock TTL omission
@Wh1isper Wh1isper requested a review from DouweM December 2, 2025 14:50
@DouweM DouweM changed the title fix: automatically omit TTL from cache_control for Bedrock clients Automatically omit TTL from cache_control when AnthropicModel is used with Bedrock client Dec 2, 2025
@DouweM DouweM merged commit c1f971d into pydantic:main Dec 2, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants