Documentation
¶
Index ¶
- Constants
- type AdapterConfig
- type PutVocabularyRequest
- type SpeechClient
- func (c *SpeechClient) DeleteLocalConfig(ctx context.Context, subjectID, scopeType, scopeID string) error
- func (c *SpeechClient) DeleteVocabulary(ctx context.Context, subjectID, scopeType, scopeID string) error
- func (c *SpeechClient) ForwardTranscribe(r *http.Request) (*http.Response, error)
- func (c *SpeechClient) ForwardTranscribeBody(ctx context.Context, body io.Reader, contentType string) (*http.Response, error)
- func (c *SpeechClient) GetConfig(ctx context.Context, subjectID, scopeType, scopeID string) (map[string]interface{}, error)
- func (c *SpeechClient) GetLocalConfig(ctx context.Context, subjectID, scopeType, scopeID string) (map[string]interface{}, error)
- func (c *SpeechClient) GetVocabulary(ctx context.Context, subjectID, scopeType, scopeID string) (*VocabularyResponse, error)
- func (c *SpeechClient) PutLocalConfig(ctx context.Context, subjectID, scopeType, scopeID string, enabled bool, ...) error
- func (c *SpeechClient) PutVocabulary(ctx context.Context, req PutVocabularyRequest) error
- func (c *SpeechClient) ResetLocalConfig(ctx context.Context, subjectID, scopeType, scopeID string, enabled bool) error
- type SpeechServiceError
- type VocabularyResponse
- type VoiceAdapter
Constants ¶
View Source
const ( EnvSpeechServiceURL = "SPEECH_SERVICE_URL" EnvSpeechAPIKey = "SPEECH_API_KEY" EnvSpeechTimeout = "SPEECH_TIMEOUT" EnvSpeechMaxBodySize = "SPEECH_MAX_BODY_SIZE" EnvFeedbackPrivacyURL = "VOICE_FEEDBACK_PRIVACY_URL" EnvFeedbackUserAgreementURL = "VOICE_FEEDBACK_USER_AGREEMENT_URL" EnvASRServiceDocFile = "VOICE_ASR_SERVICE_DOC_FILE" DefaultTimeoutSec = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterConfig ¶
type AdapterConfig struct {
SpeechServiceURL string
SpeechAPIKey string
SpeechTimeout time.Duration
MaxBodySize int64
FeedbackPrivacyURL string
UserAgreementURL string
ASRServiceDocFile string
}
func NewAdapterConfigFromEnv ¶
func NewAdapterConfigFromEnv() *AdapterConfig
type PutVocabularyRequest ¶
type SpeechClient ¶
type SpeechClient struct {
// contains filtered or unexported fields
}
func NewSpeechClient ¶
func NewSpeechClient(baseURL, apiKey string, timeout time.Duration) *SpeechClient
func (*SpeechClient) DeleteLocalConfig ¶ added in v1.5.0
func (c *SpeechClient) DeleteLocalConfig(ctx context.Context, subjectID, scopeType, scopeID string) error
func (*SpeechClient) DeleteVocabulary ¶
func (c *SpeechClient) DeleteVocabulary(ctx context.Context, subjectID, scopeType, scopeID string) error
func (*SpeechClient) ForwardTranscribe ¶
func (*SpeechClient) ForwardTranscribeBody ¶
func (*SpeechClient) GetLocalConfig ¶ added in v1.5.0
func (*SpeechClient) GetVocabulary ¶
func (c *SpeechClient) GetVocabulary(ctx context.Context, subjectID, scopeType, scopeID string) (*VocabularyResponse, error)
func (*SpeechClient) PutLocalConfig ¶ added in v1.5.0
func (*SpeechClient) PutVocabulary ¶
func (c *SpeechClient) PutVocabulary(ctx context.Context, req PutVocabularyRequest) error
func (*SpeechClient) ResetLocalConfig ¶ added in v1.5.0
type SpeechServiceError ¶
func (*SpeechServiceError) Error ¶
func (e *SpeechServiceError) Error() string
type VocabularyResponse ¶
type VoiceAdapter ¶
func NewVoiceAdapter ¶
func NewVoiceAdapter(ctx *config.Context, cfg *AdapterConfig) *VoiceAdapter
func (*VoiceAdapter) Route ¶
func (a *VoiceAdapter) Route(r *wkhttp.WKHttp)
Click to show internal directories.
Click to hide internal directories.