Documentation
¶
Index ¶
Constants ¶
View Source
const TextToSpeechToolID = "text_to_speech"
Variables ¶
View Source
var ( ErrModuleDisabled = errors.New("voice module is disabled") ErrUnsupportedProvider = errors.New("voice provider is not supported yet") )
Functions ¶
func NewTextToSpeechTool ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(setupService setupLoader) *Service
func (*Service) SpeechToText ¶
func (s *Service) SpeechToText(ctx context.Context, req SpeechToTextRequest) (SpeechToTextResponse, error)
func (*Service) TextToSpeech ¶
func (s *Service) TextToSpeech(ctx context.Context, req TextToSpeechRequest) (TextToSpeechResponse, error)
type SpeechToTextRequest ¶
type SpeechToTextRequest struct {
ContentBase64 string `json:"content_base64"`
FileName string `json:"file_name,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
Language string `json:"language,omitempty"`
}
func NewSpeechToTextRequest ¶
func NewSpeechToTextRequest(content []byte, fileName string, mimeType string) SpeechToTextRequest
func (SpeechToTextRequest) ContentBytes ¶
func (r SpeechToTextRequest) ContentBytes() ([]byte, error)
type SpeechToTextResponse ¶
type SpeechToTextResponse struct {
Text string `json:"text"`
}
type TextToSpeechRequest ¶
type TextToSpeechResponse ¶
type TextToSpeechResponse struct {
ContentBase64 string `json:"content_base64"`
MIMEType string `json:"mime_type"`
FileName string `json:"file_name"`
}
func NewTextToSpeechResponse ¶
func NewTextToSpeechResponse(content []byte, mimeType string, fileName string) TextToSpeechResponse
func (TextToSpeechResponse) ContentBytes ¶
func (r TextToSpeechResponse) ContentBytes() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.