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,
pub extended_ttl_seconds: Option<u64>,
}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)
extended_ttl_seconds: Option<u64>Extended TTL for Anthropic prompt caching (in seconds) Set to >= 3600 for 1-hour cache on messages
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_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 inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AnthropicPromptCacheSettings
impl RefUnwindSafe for AnthropicPromptCacheSettings
impl Send for AnthropicPromptCacheSettings
impl Sync for AnthropicPromptCacheSettings
impl Unpin for AnthropicPromptCacheSettings
impl UnsafeUnpin for AnthropicPromptCacheSettings
impl UnwindSafe for AnthropicPromptCacheSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more