Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlibabacloudSpeechToTextProvider ¶
type AlibabacloudSpeechToTextProvider struct {
// contains filtered or unexported fields
}
func NewAlibabacloudSpeechToTextProvider ¶
func NewAlibabacloudSpeechToTextProvider(typ string, subType string, secretKey string) (*AlibabacloudSpeechToTextProvider, error)
NewAlibabacloudSpeechToTextProvider creates a new instance of the Alibabacloud STT provider
func (*AlibabacloudSpeechToTextProvider) GetPricing ¶
func (p *AlibabacloudSpeechToTextProvider) GetPricing() string
GetPricing returns the pricing information for Alibabacloud ASR service
func (*AlibabacloudSpeechToTextProvider) ProcessAudio ¶
func (p *AlibabacloudSpeechToTextProvider) ProcessAudio(audioReader io.Reader, ctx context.Context, lang string) (string, *SpeechToTextResult, error)
ProcessAudio processes an audio stream and returns the transcribed text
type OpenAISpeechToTextProvider ¶ added in v1.832.35
type OpenAISpeechToTextProvider struct {
// contains filtered or unexported fields
}
OpenAISpeechToTextProvider forwards to any OpenAI-compatible /v1/audio/transcriptions endpoint — OpenAI itself, the in-cluster speech service, or a BYO node. providerUrl is the OpenAI-compatible /v1 root (mirroring AIBaseURL's convention); the provider appends the path. subType is the upstream model (whisper family); language, when set, is the audio's ISO-639-1 language hint, forwarded as the `language` form field.
func NewOpenAISpeechToTextProvider ¶ added in v1.832.35
func (*OpenAISpeechToTextProvider) GetPricing ¶ added in v1.832.35
func (p *OpenAISpeechToTextProvider) GetPricing() string
func (*OpenAISpeechToTextProvider) ProcessAudio ¶ added in v1.832.35
func (p *OpenAISpeechToTextProvider) ProcessAudio(audioData io.Reader, ctx context.Context, lang string) (string, *SpeechToTextResult, error)
ProcessAudio posts the audio as an OpenAI multipart transcription request and returns the transcribed text. lang is the caller's UI language (error localization elsewhere); the audio language hint is p.language.
type SpeechSegment ¶
SpeechSegment represents a single segment of transcribed speech
type SpeechToTextProvider ¶
type SpeechToTextProvider interface {
GetPricing() string
ProcessAudio(audioData io.Reader, ctx context.Context, lang string) (string, *SpeechToTextResult, error)
}
func GetSpeechToTextProvider ¶
func GetSpeechToTextProvider(typ string, subType string, clientSecret string, providerUrl string, flavor string) (SpeechToTextProvider, error)
GetSpeechToTextProvider creates a new provider instance based on the provider type. flavor mirrors the TTS factory's parameter: for STT it is the audio's language hint (ISO-639-1), bound onto the provider row by the caller.