Class: OpenAI::Models::Realtime::RealtimeResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_response.rb

Defined Under Namespace

Modules: MaxOutputTokens, Modality, Object, OutputAudioFormat, Status, Voice

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(id: nil, conversation_id: nil, max_output_tokens: nil, metadata: nil, modalities: nil, object: nil, output: nil, output_audio_format: nil, status: nil, status_details: nil, temperature: nil, usage: nil, voice: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeResponse for more details.

The response resource.

Parameters:



# File 'lib/openai/models/realtime/realtime_response.rb', line 105

Instance Attribute Details

#conversation_idString?

Which conversation the response is added to, determined by the ‘conversation` field in the `response.create` event. If `auto`, the response will be added to the default conversation and the value of `conversation_id` will be an id like `conv_1234`. If `none`, the response will not be added to any conversation and the value of `conversation_id` will be `null`. If responses are being triggered by server VAD, the response will be added to the default conversation, thus the `conversation_id` will be an id like `conv_1234`.

Returns:

  • (String, nil)


23
# File 'lib/openai/models/realtime/realtime_response.rb', line 23

optional :conversation_id, String

#idString?

The unique ID of the response.

Returns:

  • (String, nil)


11
# File 'lib/openai/models/realtime/realtime_response.rb', line 11

optional :id, String

#max_output_tokensInteger, ...

Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.

Returns:

  • (Integer, Symbol, :inf, nil)


30
# File 'lib/openai/models/realtime/realtime_response.rb', line 30

optional :max_output_tokens, union: -> { OpenAI::Realtime::RealtimeResponse::MaxOutputTokens }

#metadataHash{Symbol=>String}?

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

  • (Hash{Symbol=>String}, nil)


41
# File 'lib/openai/models/realtime/realtime_response.rb', line 41

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#modalitiesArray<Symbol, OpenAI::Models::Realtime::RealtimeResponse::Modality>?

The set of modalities the model used to respond. If there are multiple modalities, the model will pick one, for example if ‘modalities` is `[“text”, “audio”]`, the model could be responding in either text or audio.



49
50
# File 'lib/openai/models/realtime/realtime_response.rb', line 49

optional :modalities,
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeResponse::Modality] }

#objectSymbol, ...

The object type, must be ‘realtime.response`.



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

optional :object, enum: -> { OpenAI::Realtime::RealtimeResponse::Object }

#output_audio_formatSymbol, ...

The format of output audio. Options are ‘pcm16`, `g711_ulaw`, or `g711_alaw`.



68
# File 'lib/openai/models/realtime/realtime_response.rb', line 68

optional :output_audio_format, enum: -> { OpenAI::Realtime::RealtimeResponse::OutputAudioFormat }

#statusSymbol, ...

The final status of the response (‘completed`, `cancelled`, `failed`, or `incomplete`, `in_progress`).



75
# File 'lib/openai/models/realtime/realtime_response.rb', line 75

optional :status, enum: -> { OpenAI::Realtime::RealtimeResponse::Status }

#status_detailsOpenAI::Models::Realtime::RealtimeResponseStatus?

Additional details about the status.



81
# File 'lib/openai/models/realtime/realtime_response.rb', line 81

optional :status_details, -> { OpenAI::Realtime::RealtimeResponseStatus }

#temperatureFloat?

Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.

Returns:

  • (Float, nil)


87
# File 'lib/openai/models/realtime/realtime_response.rb', line 87

optional :temperature, Float

#usageOpenAI::Models::Realtime::RealtimeResponseUsage?

Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.



96
# File 'lib/openai/models/realtime/realtime_response.rb', line 96

optional :usage, -> { OpenAI::Realtime::RealtimeResponseUsage }

#voiceString, ...

The voice the model used to respond. Current voice options are ‘alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.

Returns:



103
# File 'lib/openai/models/realtime/realtime_response.rb', line 103

optional :voice, union: -> { OpenAI::Realtime::RealtimeResponse::Voice }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/realtime_response.rb', line 158

.variantsArray(Integer, Symbol, :inf)

Returns:

  • (Array(Integer, Symbol, :inf))


# File 'lib/openai/models/realtime/realtime_response.rb', line 148