pub struct PromptCacheOptionsParam {
pub ttl: Option<PromptCacheTTLEnum>,
pub mode: Option<PromptCacheModeEnum>,
}response-types and (crate features chat-completion-types or response-types) only.Expand description
Options for prompt caching. Supported for gpt-5.6 and later models. By default, OpenAI
automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content
blocks with prompt_cache_breakpoint. Each request can write up to four breakpoints. For cache
matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-
block lookback limit. Set mode to explicit to disable the implicit breakpoint. The ttl
defaults to 30m, which is currently the only supported value. See the prompt caching
guide for current details.
Fields§
§ttl: Option<PromptCacheTTLEnum>The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request.
Defaults to 30m, which is currently the only supported value. The backend may retain cache entries
for longer.
mode: Option<PromptCacheModeEnum>Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit.
With implicit, OpenAI creates one implicit breakpoint and writes up to the latest three explicit
breakpoints in the request. With explicit, OpenAI does not create an implicit breakpoint and
writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request
does not use prompt caching.
Trait Implementations§
Source§impl Clone for PromptCacheOptionsParam
impl Clone for PromptCacheOptionsParam
Source§fn clone(&self) -> PromptCacheOptionsParam
fn clone(&self) -> PromptCacheOptionsParam
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more