Class: OpenAI::Models::Beta::ResponseCompactParams

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

Overview

See Also:

  • OpenAI::Resources::Beta::Responses#compact

Defined Under Namespace

Modules: Beta, Input, Model, PromptCacheRetention, ServiceTier Classes: PromptCacheOptions

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

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

==, #==, #[], 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(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, service_tier: nil, betas: nil, request_options: {}) ⇒ Object

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

Parameters:



# File 'lib/openai/models/beta/response_compact_params.rb', line 104

Instance Attribute Details

#betasArray<Symbol, OpenAI::Models::Beta::ResponseCompactParams::Beta>?

Returns:



102
# File 'lib/openai/models/beta/response_compact_params.rb', line 102

optional :betas, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Beta::ResponseCompactParams::Beta] }

#inputString, ...

Text, image, or file inputs to the model, used to generate a response

Parameters:

  • value (OpenAI::Models::Beta::ResponseCompactParams::input, nil)

Returns:



25
# File 'lib/openai/models/beta/response_compact_params.rb', line 25

optional :input, union: -> { OpenAI::Beta::ResponseCompactParams::Input }, nil?: true

#instructionsString?

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/openai/models/beta/response_compact_params.rb', line 34

optional :instructions, String, nil?: true

#modelSymbol, ...

Model ID used to generate the response, like gpt-5 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.

Parameters:

  • value (OpenAI::Models::Beta::ResponseCompactParams::model, nil)

Returns:



19
# File 'lib/openai/models/beta/response_compact_params.rb', line 19

required :model, union: -> { OpenAI::Beta::ResponseCompactParams::Model }, nil?: true

#previous_response_idString?

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


43
# File 'lib/openai/models/beta/response_compact_params.rb', line 43

optional :previous_response_id, String, nil?: true

#prompt_cache_keyString?

A key to use when reading from or writing to the prompt cache.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :prompt_cache_key, String, nil?: true

#prompt_cache_optionsOpenAI::Models::Beta::ResponseCompactParams::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.

Parameters:

  • value (OpenAI::Beta::ResponseCompactParams::PromptCacheOptions, nil)

Returns:



63
64
65
66
67
# File 'lib/openai/models/beta/response_compact_params.rb', line 63

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

#prompt_cache_retentionSymbol, ...

Deprecated.

How long to retain a prompt cache entry created by this request.

Parameters:

  • value (OpenAI::Models::Beta::ResponseCompactParams::prompt_cache_retention, nil)

Returns:



75
76
77
# File 'lib/openai/models/beta/response_compact_params.rb', line 75

optional :prompt_cache_retention,
enum: -> { OpenAI::Beta::ResponseCompactParams::PromptCacheRetention },
nil?: true

#service_tierSymbol, ...

Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to 'flex', then the request will be processed with the Flex Processing service tier. - To opt-in to Fast mode at the request level, include the service_tier=fast or service_tier=priority parameter for Responses or Chat Completions. The response will show service_tier=priority regardless of if you specify service_tier=fast or priority in your request. - When not set, the default behavior is 'auto'. When the service_tier parameter is set, the response body will include the service_tier value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

Parameters:

  • value (OpenAI::Models::Beta::ResponseCompactParams::service_tier, nil)

Returns:



97
# File 'lib/openai/models/beta/response_compact_params.rb', line 97

optional :service_tier, enum: -> { OpenAI::Beta::ResponseCompactParams::ServiceTier }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/response_compact_params.rb', line 521

Instance Method Details

#to_hash{

Returns:

  • ({)


57
# File 'sig/openai/models/beta/response_compact_params.rbs', line 57

def to_hash: -> {