Class: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt

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

Defined Under Namespace

Modules: Model, Type

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(name:, prompt:, type:, model: nil, script_hint: nil) ⇒ Prompt

Returns a new instance of Prompt.

Parameters:

  • name —

    The name of the new voice.

  • prompt —

    A description of the desired voice. Must not contain only whitespace.

  • type —

    Set to prompt to create a voice from a text description.

  • model (defaults to: nil) —

    The voice creation model to use. Defaults to auto.

  • script_hint (defaults to: nil) —

    Optional text for the voice to speak during creation. If omitted, a script is generated from the prompt. Must not be blank after trimming whitespace; scripts that are too short are rejected.

  • name: (String)
  • prompt: (String)
  • type: (OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_)
  • model: (OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model) (defaults to: nil)
  • script_hint: (String) (defaults to: nil)


# File 'lib/openai/models/audio/voice_create_params.rb', line 150

Instance Attribute Details

#model ⇒ OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model?

The voice creation model to use. Defaults to auto.

Returns:

  • (OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model, nil)


140
# File 'lib/openai/models/audio/voice_create_params.rb', line 140

optional :model, union: -> { OpenAI::Audio::VoiceCreateParams::Body::Prompt::Model }

#name ⇒ String

The name of the new voice.

Returns:

  • (String)


122
# File 'lib/openai/models/audio/voice_create_params.rb', line 122

required :name, String

#prompt ⇒ String

A description of the desired voice. Must not contain only whitespace.

Returns:

  • (String)


128
# File 'lib/openai/models/audio/voice_create_params.rb', line 128

required :prompt, String

#script_hint ⇒ String?

Optional text for the voice to speak during creation. If omitted, a script is generated from the prompt. Must not be blank after trimming whitespace; scripts that are too short are rejected.

Returns:

  • (String, nil)


148
# File 'lib/openai/models/audio/voice_create_params.rb', line 148

optional :script_hint, String

#type ⇒ OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_

Set to prompt to create a voice from a text description.

Returns:

  • (OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_)


134
# File 'lib/openai/models/audio/voice_create_params.rb', line 134

required :type, enum: -> { OpenAI::Audio::VoiceCreateParams::Body::Prompt::Type }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/audio/voice_create_params.rb', line 179

Instance Method Details

#to_hash ⇒ { name: String, prompt: String, type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_, ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model, ?script_hint: String }

Returns:

  • ({ name: String, prompt: String, type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_, ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model, ?script_hint: String })


213
214
215
216
217
218
219
# File 'sig/openai/models/audio/voice_create_params.rbs', line 213

def to_hash: -> {
  name: String,
  prompt: String,
  type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
  ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
  ?script_hint: String
}