Class: OpenAI::Models::Beta::Responses::InputTokenCountParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Beta::Responses::InputTokenCountParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/openai/models/beta/responses/input_token_count_params.rb,
sig/openai/models/beta/responses/input_token_count_params.rbs
Overview
Defined Under Namespace
Modules: Beta, Conversation, Input, Personality, ToolChoice, Truncation Classes: Reasoning, Text
Instance Attribute Summary collapse
- #betas ⇒ Array<Symbol, OpenAI::Models::Beta::Responses::InputTokenCountParams::Beta>?
-
#conversation ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::conversation?
The conversation that this response belongs to.
-
#input ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::input?
Text, image, or file inputs to the model, used to generate a response.
-
#instructions ⇒ String?
A system (or developer) message inserted into the model's context.
-
#model ⇒ String?
Model ID used to generate the response, like
gpt-4ooro3. -
#parallel_tool_calls ⇒ Boolean?
Whether to allow the model to run tool calls in parallel.
-
#personality ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::personality?
A model-owned style preset to apply to this request.
-
#previous_response_id ⇒ String?
The unique ID of the previous response to the model.
-
#reasoning ⇒ OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?
gpt-5 and o-series models only Configuration options for reasoning models.
-
#text ⇒ OpenAI::Beta::Responses::InputTokenCountParams::Text?
Configuration options for a text response from the model.
-
#tool_choice ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?
Controls which tool the model should use, if any.
-
#tools ⇒ ::Array[OpenAI::Models::Beta::beta_tool]?
An array of tools the model may call while generating a response.
-
#truncation ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation?
The truncation strategy to use for the model response.
Attributes included from Internal::Type::RequestParameters
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(Symbol, OpenAI::Models::Beta::BetaToolChoiceOptions, OpenAI::Models::Beta::BetaToolChoiceAllowed, OpenAI::Models::Beta::BetaToolChoiceTypes, OpenAI::Models::Beta::BetaToolChoiceFunction, OpenAI::Models::Beta::BetaToolChoiceMcp, OpenAI::Models::Beta::BetaToolChoiceCustom, OpenAI::Models::Beta::Responses::InputTokenCountParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam, OpenAI::Models::Beta::BetaToolChoiceApplyPatch, OpenAI::Models::Beta::BetaToolChoiceShell)
Instance Method Summary collapse
-
#initialize(type: :programmatic_tool_calling) ⇒ InputTokenCountParams
constructor
A new instance of InputTokenCountParams.
- #to_hash ⇒ { ?conversation: OpenAI::Models::Beta::Responses::InputTokenCountParams::conversation?, ?input: OpenAI::Models::Beta::Responses::InputTokenCountParams::input?, ?instructions: String?, ?model: String?, ?parallel_tool_calls: bool?, ?personality: OpenAI::Models::Beta::Responses::InputTokenCountParams::personality, ?previous_response_id: String?, ?reasoning: OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?, ?text: OpenAI::Beta::Responses::InputTokenCountParams::Text?, ?tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?, ?tools: ::Array[OpenAI::Models::Beta::beta_tool]?, ?truncation: OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation, ?betas: ::Array[OpenAI::Models::Beta::Responses::InputTokenCountParams::beta], ?request_options: OpenAI::RequestOptions }
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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(type: :programmatic_tool_calling) ⇒ InputTokenCountParams
Returns a new instance of InputTokenCountParams.
|
|
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 131
|
Instance Attribute Details
#betas ⇒ Array<Symbol, OpenAI::Models::Beta::Responses::InputTokenCountParams::Beta>?
126 127 128 129 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 126 optional( :betas, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Beta::Responses::InputTokenCountParams::Beta] } ) |
#conversation ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::conversation?
The conversation that this response belongs to. Items from this conversation are
prepended to input_items for this response request. Input items and output
items from this response are automatically added to this conversation after this
response completes.
19 20 21 22 23 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 19 optional( :conversation, union: -> { OpenAI::Beta::Responses::InputTokenCountParams::Conversation }, nil?: true ) |
#input ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::input?
Text, image, or file inputs to the model, used to generate a response
29 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 29 optional :input, union: -> { OpenAI::Beta::Responses::InputTokenCountParams::Input }, nil?: true |
#instructions ⇒ String?
A system (or developer) message inserted into the model's context. When used
along with previous_response_id, the instructions from a previous response
will not be carried over to the next response. This makes it simple to swap out
system (or developer) messages in new responses.
38 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 38 optional :instructions, String, nil?: true |
#model ⇒ String?
Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a
wide range of models with different capabilities, performance characteristics,
and price points. Refer to the
model guide to browse and
compare available models.
48 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 48 optional :model, String, nil?: true |
#parallel_tool_calls ⇒ Boolean?
Whether to allow the model to run tool calls in parallel.
54 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 54 optional :parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true |
#personality ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::personality?
A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.
62 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 62 optional :personality, union: -> { OpenAI::Beta::Responses::InputTokenCountParams::Personality } |
#previous_response_id ⇒ String?
The unique ID of the previous response to the model. Use this to create
multi-turn conversations. Learn more about
conversation state.
Cannot be used in conjunction with conversation.
71 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 71 optional :previous_response_id, String, nil?: true |
#reasoning ⇒ OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?
gpt-5 and o-series models only Configuration options for reasoning models.
78 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 78 optional :reasoning, -> { OpenAI::Beta::Responses::InputTokenCountParams::Reasoning }, nil?: true |
#text ⇒ OpenAI::Beta::Responses::InputTokenCountParams::Text?
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
88 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 88 optional :text, -> { OpenAI::Beta::Responses::InputTokenCountParams::Text }, nil?: true |
#tool_choice ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?
Controls which tool the model should use, if any.
94 95 96 97 98 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 94 optional( :tool_choice, union: -> { OpenAI::Beta::Responses::InputTokenCountParams::ToolChoice }, nil?: true ) |
#tools ⇒ ::Array[OpenAI::Models::Beta::beta_tool]?
An array of tools the model may call while generating a response. You can
specify which tool to use by setting the tool_choice parameter.
105 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 105 optional :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::BetaTool] }, nil?: true |
#truncation ⇒ OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation?
The truncation strategy to use for the model response.
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. On some models, trimming can begin earlier because the API subtracts the model's maximum output allowance from its input limit before counting tokens.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
121 |
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 121 optional :truncation, enum: -> { OpenAI::Beta::Responses::InputTokenCountParams::Truncation } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 482
|
.variants ⇒ Array(Symbol, OpenAI::Models::Beta::BetaToolChoiceOptions, OpenAI::Models::Beta::BetaToolChoiceAllowed, OpenAI::Models::Beta::BetaToolChoiceTypes, OpenAI::Models::Beta::BetaToolChoiceFunction, OpenAI::Models::Beta::BetaToolChoiceMcp, OpenAI::Models::Beta::BetaToolChoiceCustom, OpenAI::Models::Beta::Responses::InputTokenCountParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam, OpenAI::Models::Beta::BetaToolChoiceApplyPatch, OpenAI::Models::Beta::BetaToolChoiceShell)
|
|
# File 'lib/openai/models/beta/responses/input_token_count_params.rb', line 214
|
Instance Method Details
#to_hash ⇒ { ?conversation: OpenAI::Models::Beta::Responses::InputTokenCountParams::conversation?, ?input: OpenAI::Models::Beta::Responses::InputTokenCountParams::input?, ?instructions: String?, ?model: String?, ?parallel_tool_calls: bool?, ?personality: OpenAI::Models::Beta::Responses::InputTokenCountParams::personality, ?previous_response_id: String?, ?reasoning: OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?, ?text: OpenAI::Beta::Responses::InputTokenCountParams::Text?, ?tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?, ?tools: ::Array[OpenAI::Models::Beta::beta_tool]?, ?truncation: OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation, ?betas: ::Array[OpenAI::Models::Beta::Responses::InputTokenCountParams::beta], ?request_options: OpenAI::RequestOptions }
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'sig/openai/models/beta/responses/input_token_count_params.rbs', line 196
def to_hash: -> {
?conversation: OpenAI::Models::Beta::Responses::InputTokenCountParams::conversation?,
?input: OpenAI::Models::Beta::Responses::InputTokenCountParams::input?,
?instructions: String?,
?model: String?,
?parallel_tool_calls: bool?,
?personality: OpenAI::Models::Beta::Responses::InputTokenCountParams::personality,
?previous_response_id: String?,
?reasoning: OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?,
?text: OpenAI::Beta::Responses::InputTokenCountParams::Text?,
?tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?,
?tools: ::Array[OpenAI::Models::Beta::beta_tool]?,
?truncation: OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation,
?betas: ::Array[OpenAI::Models::Beta::Responses::InputTokenCountParams::beta],
?request_options: OpenAI::RequestOptions
}
|