Class: OpenAI::Audio

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/audio.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Audio

Returns a new instance of Audio.



3
4
5
# File 'lib/openai/audio.rb', line 3

def initialize(client:)
  @client = client
end

Instance Method Details

#speech(parameters: {}) ⇒ Object



15
16
17
# File 'lib/openai/audio.rb', line 15

def speech(parameters: {})
  @client.json_post(path: "/audio/speech", parameters: parameters)
end

#transcribe(parameters: {}) ⇒ Object



7
8
9
# File 'lib/openai/audio.rb', line 7

def transcribe(parameters: {})
  @client.multipart_post(path: "/audio/transcriptions", parameters: parameters)
end

#translate(parameters: {}) ⇒ Object



11
12
13
# File 'lib/openai/audio.rb', line 11

def translate(parameters: {})
  @client.multipart_post(path: "/audio/translations", parameters: parameters)
end