Documentation
¶
Index ¶
- func NewSpeechRequestOptions(body io.ReadCloser) mo.Result[SpeechRequestOptions]
- func NewVoicesRequestOptions(request *http.Request) mo.Result[VoicesRequestOptions]
- type ListVoicesResponse
- type OpenAISpeechRequestOptions
- type SpeechRequestOptions
- type Voice
- type VoiceCommonLabels
- type VoiceFormat
- type VoiceLabelKey
- type VoiceLanguage
- type VoicesRequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSpeechRequestOptions ¶
func NewSpeechRequestOptions(body io.ReadCloser) mo.Result[SpeechRequestOptions]
func NewVoicesRequestOptions ¶ added in v0.1.0
func NewVoicesRequestOptions(request *http.Request) mo.Result[VoicesRequestOptions]
Types ¶
type ListVoicesResponse ¶ added in v0.1.0
type ListVoicesResponse struct {
Voices []Voice `json:"voices"`
}
type OpenAISpeechRequestOptions ¶
type OpenAISpeechRequestOptions struct {
// (required) One of the available TTS models.
Model string `json:"model"`
// (required) The text to generate audio for.
Input string `json:"input"`
// (required) The voice to use when generating the audio.
Voice string `json:"voice"`
// The format to audio in.
// Supported formats are mp3, opus, aac, flac, wav, and pcm.
// mp3 is the default.
ResponseFormat string `json:"response_format,omitempty"`
// The speed of the generated audio.
// Select a value from 0.25 to 4.0.
// 1.0 is the default.
Speed int `json:"speed,omitempty"`
// Extension: allows you to add custom content to body.
ExtraBody map[string]any `json:"extra_body,omitempty"`
}
OpenAISpeechRequestOptions represent API parameters refer to https://platform.openai.com/docs/api-reference/audio/createSpeech
type SpeechRequestOptions ¶
type SpeechRequestOptions struct {
OpenAISpeechRequestOptions
Backend string `json:"backend"`
Model string `json:"model"`
// contains filtered or unexported fields
}
func (SpeechRequestOptions) AsBuffer ¶
func (o SpeechRequestOptions) AsBuffer() mo.Option[*bytes.Buffer]
func (SpeechRequestOptions) AsMap ¶
func (o SpeechRequestOptions) AsMap() map[string]any
type Voice ¶ added in v0.1.0
type Voice struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Labels map[string]any `json:"labels"`
Tags []string `json:"tags"`
Languages []VoiceLanguage `json:"languages"`
Formats []VoiceFormat `json:"formats"`
CompatibleModels []string `json:"compatible_models"`
PredefinedOptions map[string]any `json:"predefined_options"`
PreviewAudioURL string `json:"preview_audio_url"`
}
type VoiceCommonLabels ¶ added in v0.1.0
type VoiceFormat ¶ added in v0.1.0
type VoiceLabelKey ¶ added in v0.1.0
type VoiceLabelKey = string
const ( VoiceLabelKeyAge VoiceLabelKey = "age" VoiceLabelKeyGender VoiceLabelKey = "gender" VoiceLabelKeyAccent VoiceLabelKey = "accent" VoiceLabelKeyType VoiceLabelKey = "type" )
type VoiceLanguage ¶ added in v0.1.0
type VoicesRequestOptions ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.