We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8be4dfe commit ee9424eCopy full SHA for ee9424e
README.md
@@ -134,3 +134,34 @@ func main() {
134
}
135
```
136
</details>
137
+
138
+<details>
139
+<summary>Audio Speech-To-Text</summary>
140
141
+```go
142
+package main
143
144
+import (
145
+ "context"
146
+ "fmt"
147
148
+ openai "github.com/sashabaranov/go-openai"
149
+)
150
151
+func main() {
152
+ c := openai.NewClient("your token")
153
+ ctx := context.Background()
154
155
+ req := openai.AudioRequest{
156
+ Model: openai.Whisper1,
157
+ FilePath: "recording.mp3",
158
+ }
159
+ resp, err := c.CreateTranscription(ctx, req)
160
+ if err != nil {
161
+ fmt.Printf("Transcription error: %v\n", err)
162
+ return
163
164
+ fmt.Println(resp.Text)
165
+}
166
+```
167
+</details>
0 commit comments