pub struct OpenAIPromptCacheSettings {
pub enabled: bool,
pub surface_metrics: bool,
pub auxiliary_explicit_cache: bool,
pub prompt_cache_key_mode: OpenAIPromptCacheKeyMode,
pub prompt_cache_retention: Option<PromptCacheRetention>,
pub prompt_cache_ttl: Option<PromptCacheTtl>,
pub stable_prefix_ttl: Option<PromptCacheTtl>,
/* private fields */
}Expand description
OpenAI prompt caching controls (automatic with metrics)
Fields§
§enabled: bool§surface_metrics: bool§auxiliary_explicit_cache: boolOpt in to stable-instruction-only cache writes for independent native GPT-5.6+ auxiliary requests. Interactive requests keep implicit caching.
prompt_cache_key_mode: OpenAIPromptCacheKeyModeStrategy for generating OpenAI prompt_cache_key.
Session-scoped keys derive one stable key per VT Code conversation.
prompt_cache_retention: Option<PromptCacheRetention>Optional prompt cache retention policy to pass directly into OpenAI Responses API.
Supported values are “in_memory” and “24h”. If set, VT Code will include
prompt_cache_retention in the request body to extend the model-side prompt
caching window or request the explicit in-memory policy.
prompt_cache_ttl: Option<PromptCacheTtl>Optional Responses minimum write lifetime; defaults to catalog policy or 30m.
stable_prefix_ttl: Option<PromptCacheTtl>Optional lifetime for the stable developer-instruction cache breakpoint on native
GPT-5.6+ Responses routes. When unset, the breakpoint inherits prompt_cache_ttl.
Set to "12h" to keep the stable prefix reusable across longer gaps while session
history stays at the shorter request lifetime. 12-hour writes cost 2.5x ordinary
input versus 1.25x for 30-minute writes. Options: “30m”, “12h”.
Trait Implementations§
Source§impl Clone for OpenAIPromptCacheSettings
impl Clone for OpenAIPromptCacheSettings
Source§impl Debug for OpenAIPromptCacheSettings
impl Debug for OpenAIPromptCacheSettings
Source§impl Default for OpenAIPromptCacheSettings
impl Default for OpenAIPromptCacheSettings
Source§impl<'de> Deserialize<'de> for OpenAIPromptCacheSettings
impl<'de> Deserialize<'de> for OpenAIPromptCacheSettings
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 OpenAIPromptCacheSettings
impl JsonSchema for OpenAIPromptCacheSettings
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 more