Class: OpenAI::Resources::Audio::Speech
- Inherits:
-
Object
- Object
- OpenAI::Resources::Audio::Speech
- Defined in:
- lib/openai/resources/audio/speech.rb
Instance Method Summary collapse
-
#create(input: , model: , voice: , instructions: nil, response_format: nil, speed: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Audio::SpeechCreateParams for more details.
-
#initialize(client:) ⇒ Speech
constructor
private
A new instance of Speech.
Constructor Details
#initialize(client:) ⇒ Speech
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Speech.
46 47 48 |
# File 'lib/openai/resources/audio/speech.rb', line 46 def initialize(client:) @client = client end |
Instance Method Details
#create(input: , model: , voice: , instructions: nil, response_format: nil, speed: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Audio::SpeechCreateParams for more details.
Generates audio from the input text.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/openai/resources/audio/speech.rb', line 31 def create(params) parsed, = OpenAI::Audio::SpeechCreateParams.dump_request(params) @client.request( method: :post, path: "audio/speech", headers: {"accept" => "application/octet-stream"}, body: parsed, model: StringIO, options: ) end |