Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions speech.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ import (
type SpeechModel string

const (
TTSModel1 SpeechModel = "tts-1"
TTSModel1HD SpeechModel = "tts-1-hd"
TTSModelCanary SpeechModel = "canary-tts"
TTSModel1 SpeechModel = "tts-1"
TTSModel1HD SpeechModel = "tts-1-hd"
TTSModelCanary SpeechModel = "canary-tts"
TTSModelGPT4oMini SpeechModel = "gpt-4o-mini-tts"
)

type SpeechVoice string

const (
VoiceAlloy SpeechVoice = "alloy"
VoiceAsh SpeechVoice = "ash"
VoiceBallad SpeechVoice = "ballad"
VoiceCoral SpeechVoice = "coral"
VoiceEcho SpeechVoice = "echo"
VoiceFable SpeechVoice = "fable"
VoiceOnyx SpeechVoice = "onyx"
VoiceNova SpeechVoice = "nova"
VoiceShimmer SpeechVoice = "shimmer"
VoiceVerse SpeechVoice = "verse"
)

type SpeechResponseFormat string
Expand All @@ -39,6 +44,7 @@ type CreateSpeechRequest struct {
Model SpeechModel `json:"model"`
Input string `json:"input"`
Voice SpeechVoice `json:"voice"`
Instructions string `json:"instructions,omitempty"` // Optional, Doesnt work with tts-1 or tts-1-hd.
ResponseFormat SpeechResponseFormat `json:"response_format,omitempty"` // Optional, default to mp3
Speed float64 `json:"speed,omitempty"` // Optional, default to 1.0
}
Expand Down
Loading