Skip to main content

apply_prompt_cache_hints

Function apply_prompt_cache_hints 

Source
pub fn apply_prompt_cache_hints(request: &mut ChatRequest)
Expand description

Apply prompt cache hints to a chat request.

Sets CacheControl::Ephemeral on the last system message in the request, which tells Anthropic to cache everything up to (and including) that message. This is a no-op for providers that don’t support cache control.