Class: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/beta_responses_client_event.rb

Overview

See Also:

  • OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate#prompt_cache_options

Defined Under Namespace

Modules: Mode, Ttl

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(mode: nil, ttl: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions for more details.

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.

Parameters:



# File 'lib/openai/models/beta/beta_responses_client_event.rb', line 1023

Instance Attribute Details

#modeSymbol, ...

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.



1011
1012
# File 'lib/openai/models/beta/beta_responses_client_event.rb', line 1011

optional :mode,
enum: -> { OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode }

#ttlSymbol, ...

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.



1020
1021
# File 'lib/openai/models/beta/beta_responses_client_event.rb', line 1020

optional :ttl,
enum: -> { OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/beta_responses_client_event.rb', line 1056