Class: OpenAI::Models::DecisionCreateParams::PromptCacheOptions

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/decision_create_params.rb,
sig/openai/models/decision_create_params.rbs

Defined Under Namespace

Modules: Mode, Ttl

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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) ⇒ PromptCacheOptions

Returns a new instance of PromptCacheOptions.

Parameters:

  • mode (defaults to: nil) —

    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.

  • ttl (defaults to: nil) —

    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: (OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode, nil) (defaults to: nil)
  • ttl: (OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl) (defaults to: nil)


# File 'lib/openai/models/decision_create_params.rb', line 1077

Instance Attribute Details

#mode ⇒ OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode?

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.

Returns:

  • (OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode, nil)


1067
# File 'lib/openai/models/decision_create_params.rb', line 1067

optional :mode, enum: -> { OpenAI::DecisionCreateParams::PromptCacheOptions::Mode }, nil?: true

#ttl ⇒ OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl?

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.

Returns:

  • (OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl, nil)


1075
# File 'lib/openai/models/decision_create_params.rb', line 1075

optional :ttl, enum: -> { OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/decision_create_params.rb', line 1115

Instance Method Details

#to_hash ⇒ { ?mode: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode?, ?ttl: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl }

Returns:

  • ({ ?mode: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode?, ?ttl: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl })


969
970
971
972
# File 'sig/openai/models/decision_create_params.rbs', line 969

def to_hash: -> {
  ?mode: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::mode?,
  ?ttl: OpenAI::Models::DecisionCreateParams::PromptCacheOptions::ttl
}