We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0cb3290 + 8423964 commit 651fe99Copy full SHA for 651fe99
README.md
@@ -1674,6 +1674,20 @@ puts response["text"]
1674
# => "Transcription of the text"
1675
```
1676
1677
+If you are using Ruby on Rails with Active Storage, you would need to send an audio or video file like this (User has_one_attached):
1678
+```ruby
1679
+user.media.blob.open do |file|
1680
+ response = client.audio.transcribe(
1681
+ parameters: {
1682
+ model: "whisper-1",
1683
+ file: File.open(temp_file, "rb"),
1684
+ language: "en" # Optional
1685
+ })
1686
+ puts response["text"]
1687
+ # => "Transcription of the text"
1688
+end
1689
+```
1690
+
1691
#### Speech
1692
1693
The speech API takes as input the text and a voice and returns the content of an audio file you can listen to.
0 commit comments