Class: OpenAI::Models::Audio::Voice

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

Overview

See Also:

  • OpenAI::Resources::Audio::Voices#create

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

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(id:, created_at:, name:, type:, prompt: nil, object: :"audio.voice") ⇒ Voice

Returns a new instance of Voice.

Parameters:

  • id —

    The voice identifier, which can be referenced in API endpoints.

  • created_at —

    The Unix timestamp (in seconds) for when the voice was created.

  • name —

    The name of the voice.

  • type —

    How the voice was created.

  • prompt (defaults to: nil) —

    The original text prompt used to create the voice. Present for prompt-generated voices with a stored prompt; omitted for audio-sample voices and older voices without a stored prompt.

  • object (defaults to: :"audio.voice") —

    The object type, which is always audio.voice.

  • id: (String)
  • created_at: (Integer)
  • name: (String)
  • type: (OpenAI::Models::Audio::Voice::type_)
  • prompt: (String) (defaults to: nil)
  • object: (:"audio.voice") (defaults to: :"audio.voice")


# File 'lib/openai/models/audio/voice.rb', line 46

Instance Attribute Details

#created_at ⇒ Integer

The Unix timestamp (in seconds) for when the voice was created.

Returns:

  • (Integer)


18
# File 'lib/openai/models/audio/voice.rb', line 18

required :created_at, Integer

#id ⇒ String

The voice identifier, which can be referenced in API endpoints.

Returns:

  • (String)


12
# File 'lib/openai/models/audio/voice.rb', line 12

required :id, String

#name ⇒ String

The name of the voice.

Returns:

  • (String)


24
# File 'lib/openai/models/audio/voice.rb', line 24

required :name, String

#object ⇒ :"audio.voice"

The object type, which is always audio.voice.

Returns:

  • (:"audio.voice")


30
# File 'lib/openai/models/audio/voice.rb', line 30

required :object, const: :"audio.voice"

#prompt ⇒ String?

The original text prompt used to create the voice. Present for prompt-generated voices with a stored prompt; omitted for audio-sample voices and older voices without a stored prompt.

Returns:

  • (String, nil)


44
# File 'lib/openai/models/audio/voice.rb', line 44

optional :prompt, String

#type ⇒ OpenAI::Models::Audio::Voice::type_

How the voice was created.

Returns:

  • (OpenAI::Models::Audio::Voice::type_)


36
# File 'lib/openai/models/audio/voice.rb', line 36

required :type, enum: -> { OpenAI::Audio::Voice::Type }

Instance Method Details

#to_hash ⇒ { id: String, created_at: Integer, name: String, ?object: :"audio.voice", type: OpenAI::Models::Audio::Voice::type_, ?prompt: String }

Returns:

  • ({ id: String, created_at: Integer, name: String, ?object: :"audio.voice", type: OpenAI::Models::Audio::Voice::type_, ?prompt: String })


63
64
65
66
67
68
69
70
# File 'sig/openai/models/audio/voice.rbs', line 63

def to_hash: -> {
  id: String,
  created_at: Integer,
  name: String,
  ?object: :"audio.voice",
  type: OpenAI::Models::Audio::Voice::type_,
  ?prompt: String
}