Documentation
¶
Index ¶
- Constants
- func StreamingCredentialsPresent() bool
- type Provider
- func (*Provider) Capabilities() []speechkit.Capability
- func (p *Provider) Health(ctx context.Context) error
- func (p *Provider) Name() string
- func (p *Provider) SetStreamingCredentialEnvs(credentialsJSONEnv, applicationCredentialsEnv string)
- func (p *Provider) StartSpeakerStream(ctx context.Context, opts speaker.Options, format speaker.AudioFormat) (speaker.SpeakerStream, error)
- func (p *Provider) Transcribe(ctx context.Context, audio []byte, opts stt.TranscribeOpts) (*stt.Result, error)
Constants ¶
const ( EnvAPIKey = envGoogleSTTAPIKey EnvCloudAPIKey = envGoogleCloudSTTAPIKey EnvLegacyAPIKey = envGoogleLegacySTTAPIKey EnvCredentialsJSON = envGoogleSTTCredentialsJSON EnvApplicationCredentials = envGoogleApplicationCreds )
Credential env names a host can present to a user when streaming transcription is unavailable for lack of credentials.
Variables ¶
This section is empty.
Functions ¶
func StreamingCredentialsPresent ¶ added in v0.64.3
func StreamingCredentialsPresent() bool
StreamingCredentialsPresent reports whether service-account or ADC credentials are configured for streaming recognition. Batch transcription only needs an API key and is unaffected.
Types ¶
type Provider ¶
type Provider struct {
APIKey string
Model string // "latest_long", "latest_short", or another Google STT v1 model tag
STTCredentialsJSONEnv string
ApplicationCredentialsEnv string
BaseURL string // Override for testing; defaults to googleSTTBaseURL
Validation netsec.ValidationOptions
// contains filtered or unexported fields
}
Provider implements stt.STTProvider for Google Cloud Speech-to-Text v1 REST API.
BaseURL is user-configurable (for testing or regional endpoints). It is validated against Validation on every request. Default Validation is strict (public https only).
func New ¶
New creates a provider for Google Cloud Speech-to-Text. Model defaults to "latest_long" if empty.
func (*Provider) Capabilities ¶ added in v0.64.3
func (*Provider) Capabilities() []speechkit.Capability
Capabilities reports what this provider does beyond plain transcription.
func (*Provider) SetStreamingCredentialEnvs ¶ added in v0.64.3
func (*Provider) StartSpeakerStream ¶ added in v0.64.3
func (p *Provider) StartSpeakerStream(ctx context.Context, opts speaker.Options, format speaker.AudioFormat) (speaker.SpeakerStream, error)
StartSpeakerStream opens a Google Cloud Speech-to-Text v2 StreamingRecognize session.
IMPORTANT: Google STT v2 does NOT support speaker diarization in streaming mode — diarization is available only in BatchRecognize/Recognize (see the Chirp-3 docs). This adapter therefore provides realtime TRANSCRIPTION only: frames carry Text without speaker labels (no Segment/Speakers). Streaming speaker diarization in the Voice Agent comes from Deepgram/AssemblyAI.