Class: Typecast::Models::TTSRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/typecast/models.rb

Direct Known Subclasses

TTSRequestStream

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voice_id:, text:, model:, language: nil, prompt: nil, output: nil, seed: nil) ⇒ TTSRequest

Returns a new instance of TTSRequest.



93
94
95
96
97
98
99
100
101
# File 'lib/typecast/models.rb', line 93

def initialize(voice_id:, text:, model:, language: nil, prompt: nil, output: nil, seed: nil)
  @voice_id = voice_id
  @text = text
  @model = model
  @language = language
  @prompt = prompt
  @output = output
  @seed = seed
end

Instance Attribute Details

#languageObject (readonly)

Returns the value of attribute language.



91
92
93
# File 'lib/typecast/models.rb', line 91

def language
  @language
end

#modelObject (readonly)

Returns the value of attribute model.



91
92
93
# File 'lib/typecast/models.rb', line 91

def model
  @model
end

#outputObject (readonly)

Returns the value of attribute output.



91
92
93
# File 'lib/typecast/models.rb', line 91

def output
  @output
end

#promptObject (readonly)

Returns the value of attribute prompt.



91
92
93
# File 'lib/typecast/models.rb', line 91

def prompt
  @prompt
end

#seedObject (readonly)

Returns the value of attribute seed.



91
92
93
# File 'lib/typecast/models.rb', line 91

def seed
  @seed
end

#textObject (readonly)

Returns the value of attribute text.



91
92
93
# File 'lib/typecast/models.rb', line 91

def text
  @text
end

#voice_idObject (readonly)

Returns the value of attribute voice_id.



91
92
93
# File 'lib/typecast/models.rb', line 91

def voice_id
  @voice_id
end

Instance Method Details

#to_hObject



103
104
105
106
107
108
109
110
111
112
113
# File 'lib/typecast/models.rb', line 103

def to_h
  Models.compact(
    voice_id: voice_id,
    text: text,
    model: model,
    language: language,
    prompt: Models.value_to_h(prompt),
    output: Models.value_to_h(output),
    seed: seed
  )
end