Documentation
¶
Index ¶
- func NewJSONResponseError(statusCode int, responseBody io.Reader) mo.Result[*JSONResponseError]
- func NewSpeechRequestOptions(body io.ReadCloser) mo.Result[SpeechRequestOptions]
- func NewTextResponseError(statusCode int, responseBody io.Reader) mo.Result[*TextResponseError]
- func Speech(c echo.Context) mo.Result[any]
- type JSONResponseError
- type OpenAISpeechRequestOptions
- type SpeechRequestOptions
- type TextResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJSONResponseError ¶
func NewSpeechRequestOptions ¶ added in v0.0.3
func NewSpeechRequestOptions(body io.ReadCloser) mo.Result[SpeechRequestOptions]
func NewTextResponseError ¶
Types ¶
type JSONResponseError ¶
type JSONResponseError struct {
StatusCode int `json:"status_code"`
Message string `json:"message"`
// contains filtered or unexported fields
}
func (*JSONResponseError) Error ¶
func (r *JSONResponseError) Error() string
type OpenAISpeechRequestOptions ¶ added in v0.0.3
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 ¶ added in v0.0.3
type SpeechRequestOptions struct {
OpenAISpeechRequestOptions
Backend string `json:"backend"`
Model string `json:"model"`
// contains filtered or unexported fields
}
func (SpeechRequestOptions) AsBuffer ¶ added in v0.0.3
func (o SpeechRequestOptions) AsBuffer() mo.Option[*bytes.Buffer]
func (SpeechRequestOptions) AsMap ¶ added in v0.0.3
func (o SpeechRequestOptions) AsMap() map[string]any
type TextResponseError ¶
func (*TextResponseError) Error ¶
func (r *TextResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.