diff --git a/README.md b/README.md index c5ece9d..3a26a3d 100644 --- a/README.md +++ b/README.md @@ -134,3 +134,34 @@ func main() { } ``` + +
+Audio Speech-To-Text + +```go +package main + +import ( + "context" + "fmt" + + openai "github.com/sashabaranov/go-openai" +) + +func main() { + c := openai.NewClient("your token") + ctx := context.Background() + + req := openai.AudioRequest{ + Model: openai.Whisper1, + FilePath: "recording.mp3", + } + resp, err := c.CreateTranscription(ctx, req) + if err != nil { + fmt.Printf("Transcription error: %v\n", err) + return + } + fmt.Println(resp.Text) +} +``` +