pub struct AnthropicPromptCacheSettings {
pub enabled: bool,
pub tools_ttl_seconds: u64,
pub messages_ttl_seconds: u64,
pub max_breakpoints: u8,
pub cache_system_messages: bool,
pub cache_user_messages: bool,
pub cache_tool_definitions: bool,
pub min_message_length_for_cache: usize,
}Expand description
Anthropic Claude cache control settings
Fields§
§enabled: bool§tools_ttl_seconds: u64Default TTL in seconds for the first cache breakpoint (tools/system). Anthropic only supports “5m” (300s) or “1h” (3600s) TTL formats. Set to >= 3600 for 1-hour cache on tools and system prompts. Default: 3600 (1 hour) - recommended for stable tool definitions
messages_ttl_seconds: u64TTL for subsequent cache breakpoints (messages). Set to >= 3600 for 1-hour cache on messages. Default: 300 (5 minutes) - recommended for frequently changing messages
max_breakpoints: u8Maximum number of cache breakpoints to use (max 4 per Anthropic spec). Default: 4
cache_system_messages: boolApply cache control to system prompts by default
cache_user_messages: boolApply cache control to user messages exceeding threshold
cache_tool_definitions: boolApply cache control to tool definitions by default Default: true (tools are typically stable and benefit from longer caching)
min_message_length_for_cache: usizeMinimum message length (in characters) before applying cache control to avoid caching very short messages that don’t benefit from caching. Default: 256 characters (~64 tokens)
Trait Implementations§
Source§impl Clone for AnthropicPromptCacheSettings
impl Clone for AnthropicPromptCacheSettings
Source§fn clone(&self) -> AnthropicPromptCacheSettings
fn clone(&self) -> AnthropicPromptCacheSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnthropicPromptCacheSettings
impl Debug for AnthropicPromptCacheSettings
Source§impl<'de> Deserialize<'de> for AnthropicPromptCacheSettings
impl<'de> Deserialize<'de> for AnthropicPromptCacheSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AnthropicPromptCacheSettings
impl JsonSchema for AnthropicPromptCacheSettings
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more