Class: OpenAI::Models::Chat::ChatCompletionAudioParam

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

Defined Under Namespace

Modules: Format, Voice

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(format_:, voice:) ⇒ ChatCompletionAudioParam

Returns a new instance of ChatCompletionAudioParam.

Parameters:

  • format_ —

    Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.

  • voice —

    The voice the model uses to respond. Supported built-in voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, marin, and cedar. You may also provide a custom voice object with an id, for example { "id": "voice_1234" }. Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.

  • format_: (OpenAI::Models::Chat::ChatCompletionAudioParam::format_)
  • voice: (OpenAI::Models::Chat::ChatCompletionAudioParam::voice)


# File 'lib/openai/models/chat/chat_completion_audio_param.rb', line 24

Instance Attribute Details

#format_ ⇒ OpenAI::Models::Chat::ChatCompletionAudioParam::format_

Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.

Returns:

  • (OpenAI::Models::Chat::ChatCompletionAudioParam::format_)


12
# File 'lib/openai/models/chat/chat_completion_audio_param.rb', line 12

required :format_, enum: -> { OpenAI::Chat::ChatCompletionAudioParam::Format }, api_name: :format

#voice ⇒ OpenAI::Models::Chat::ChatCompletionAudioParam::voice

The voice the model uses to respond. Supported built-in voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, marin, and cedar. You may also provide a custom voice object with an id, for example { "id": "voice_1234" }. Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.

Returns:

  • (OpenAI::Models::Chat::ChatCompletionAudioParam::voice)


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

required :voice, union: -> { OpenAI::Chat::ChatCompletionAudioParam::Voice }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/chat/chat_completion_audio_param.rb', line 54

Instance Method Details

#to_hash ⇒ { format_: OpenAI::Models::Chat::ChatCompletionAudioParam::format_, voice: OpenAI::Models::Chat::ChatCompletionAudioParam::voice }

Returns:

  • ({ format_: OpenAI::Models::Chat::ChatCompletionAudioParam::format_, voice: OpenAI::Models::Chat::ChatCompletionAudioParam::voice })


38
39
40
41
# File 'sig/openai/models/chat/chat_completion_audio_param.rbs', line 38

def to_hash: -> {
  format_: OpenAI::Models::Chat::ChatCompletionAudioParam::format_,
  voice: OpenAI::Models::Chat::ChatCompletionAudioParam::voice
}