Class: OpenAI::Models::DecisionCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/decision_create_params.rb,
sig/openai/models/decision_create_params.rbs

Overview

See Also:

  • OpenAI::Resources::Decisions#create

Defined Under Namespace

Modules: Input, Question Classes: PromptCacheOptions

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(label:, description: nil) ⇒ DecisionCreateParams

Returns a new instance of DecisionCreateParams.

Parameters:

  • input —

    The input to evaluate for every question. Provide a text string or an ordered array of messages, function calls and outputs, or custom tool calls and outputs. Each tool output must identify a matching call by call ID.

  • model —

    The model to use. Only gpt-6-luna is supported.

  • questions —

    Ask 1–400 questions about the input. Each question can be a predicate, choice, or score. Answers come back in the same order.

  • prompt_cache_key —

    Partition prompt cache reuse by caller-provided key.

  • prompt_cache_options —

    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.

  • safety_identifier —

    Opaque caller-provided end-user identifier, scoped by the verified org. Match Responses' limit; this is never the authenticated user identity.

  • input: (OpenAI::Models::DecisionCreateParams::input)
  • model: (String)
  • questions: (::Array[OpenAI::Models::DecisionCreateParams::question | { instructions: String | ::Array[OpenAI::Models::decision_question_input_part], type: :predicate, ?name: String } | { choices: ::Array[OpenAI::Models::DecisionCreateParams::Question::Choice::Choice], instructions: String | ::Array[OpenAI::Models::decision_question_input_part], type: :choice, ?name: String } | { instructions: String | ::Array[OpenAI::Models::decision_question_input_part], levels: ::Array[OpenAI::Models::DecisionCreateParams::Question::Score::Level], type: :score, ?name: String }])
  • prompt_cache_key: (String, nil)
  • prompt_cache_options: (OpenAI::DecisionCreateParams::PromptCacheOptions, OpenAI::Models::DecisionCreateParams::prompt_cache_options, nil)
  • safety_identifier: (String, nil)
  • request_options: (OpenAI::request_opts)


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

Instance Attribute Details

#input ⇒ OpenAI::Models::DecisionCreateParams::input

The input to evaluate for every question. Provide a text string or an ordered array of messages, function calls and outputs, or custom tool calls and outputs. Each tool output must identify a matching call by call ID.

Returns:

  • (OpenAI::Models::DecisionCreateParams::input)


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

required :input, union: -> { OpenAI::DecisionCreateParams::Input }

#model ⇒ String

The model to use. Only gpt-6-luna is supported.

Returns:

  • (String)


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

required :model, String

#prompt_cache_key ⇒ String?

Partition prompt cache reuse by caller-provided key.

Returns:

  • (String, nil)


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

optional :prompt_cache_key, String, nil?: true

#prompt_cache_options ⇒ (OpenAI::DecisionCreateParams::PromptCacheOptions

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.

Returns:

  • ((OpenAI::DecisionCreateParams::PromptCacheOptions)


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

optional :prompt_cache_options, -> { OpenAI::DecisionCreateParams::PromptCacheOptions }, nil?: true

#questions ⇒ ::Array[OpenAI::Models::DecisionCreateParams::question]

Ask 1–400 questions about the input. Each question can be a predicate, choice, or score. Answers come back in the same order.

Returns:

  • (::Array[OpenAI::Models::DecisionCreateParams::question])


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

required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::DecisionCreateParams::Question] }

#safety_identifier ⇒ String?

Opaque caller-provided end-user identifier, scoped by the verified org. Match Responses' limit; this is never the authenticated user identity.

Returns:

  • (String, nil)


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

optional :safety_identifier, String, nil?: true

Class Method Details

.variants ⇒ Array(OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score)



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

Instance Method Details

#to_hash ⇒ { input: OpenAI::Models::DecisionCreateParams::input, model: String, questions: ::Array[OpenAI::Models::DecisionCreateParams::question], ?prompt_cache_key: String?, ?prompt_cache_options: (OpenAI::DecisionCreateParams::PromptCacheOptions | OpenAI::Models::DecisionCreateParams::prompt_cache_options)?, ?safety_identifier: String?, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ input: OpenAI::Models::DecisionCreateParams::input, model: String, questions: ::Array[OpenAI::Models::DecisionCreateParams::question], ?prompt_cache_key: String?, ?prompt_cache_options: (OpenAI::DecisionCreateParams::PromptCacheOptions | OpenAI::Models::DecisionCreateParams::prompt_cache_options)?, ?safety_identifier: String?, ?request_options: OpenAI::RequestOptions })


151
152
153
154
155
156
157
158
159
160
# File 'sig/openai/models/decision_create_params.rbs', line 151

def to_hash: -> {
  input: OpenAI::Models::DecisionCreateParams::input,
  model: String,
  questions: ::Array[OpenAI::Models::DecisionCreateParams::question],
  ?prompt_cache_key: String?,
  ?prompt_cache_options: (OpenAI::DecisionCreateParams::PromptCacheOptions
  | OpenAI::Models::DecisionCreateParams::prompt_cache_options)?,
  ?safety_identifier: String?,
  ?request_options: OpenAI::RequestOptions
}