Skip to content

Commit 9266a67

Browse files
authored
Merge pull request #476 from krschacht/readme-for-audio
Update README audio section to show full parameter support
2 parents 775eabe + f30d6b9 commit 9266a67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ For a more robust setup, you can configure the gem with your API keys, for examp
114114
```ruby
115115
OpenAI.configure do |config|
116116
config.access_token = ENV.fetch("OPENAI_ACCESS_TOKEN")
117-
config.organization_id = ENV.fetch("OPENAI_ORGANIZATION_ID") # Optional.
117+
config.organization_id = ENV.fetch("OPENAI_ORGANIZATION_ID") # Optional
118118
config.log_errors = true # Highly recommended in development, so you can see what errors OpenAI is returning. Not recommended in production.
119119
end
120120
```
@@ -995,7 +995,7 @@ response = client.audio.transcribe(
995995
parameters: {
996996
model: "whisper-1",
997997
file: File.open("path_to_file", "rb"),
998-
language: "en" # Optional.
998+
language: "en" # Optional
999999
})
10001000
puts response["text"]
10011001
# => "Transcription of the text"
@@ -1010,7 +1010,9 @@ response = client.audio.speech(
10101010
parameters: {
10111011
model: "tts-1",
10121012
input: "This is a speech test!",
1013-
voice: "alloy"
1013+
voice: "alloy",
1014+
response_format: "mp3", # Optional
1015+
speed: 1.0 # Optional
10141016
}
10151017
)
10161018
File.binwrite('demo.mp3', response)

0 commit comments

Comments
 (0)