Documentation
¶
Overview ¶
Package azurespeech implements stt.STTProvider on the Azure Speech fast-transcription surface of a Microsoft Foundry resource. That surface is where Microsoft's own MAI-Transcribe models live: they are not deployments, never show up on the OpenAI-compatible /openai/v1 route, and are addressed on the resource's custom domain instead.
Index ¶
Constants ¶
const ( // APIVersion is the fast-transcription API version this adapter speaks // (verified live 2026-09-04). APIVersion = "2025-10-15" // DefaultModel is the MAI transcription model used when none is configured. DefaultModel = "MAI-Transcribe-2" )
Variables ¶
This section is empty.
Functions ¶
func IsMAITranscribeModel ¶
IsMAITranscribeModel reports whether model names a Microsoft MAI transcription model, which is what decides between this adapter and the OpenAI-compatible route.
func ShortLocale ¶
ShortLocale converts a BCP-47 tag to the primary language subtag MAI expects in "locales": de-DE -> de, pt-BR -> pt, zh-CN -> zh. Three-letter tags such as yue or fil pass through unchanged.
Types ¶
type Options ¶
type Options struct {
// Host is the resource's custom domain, e.g.
// "myresource.cognitiveservices.azure.com" (no scheme). Required.
Host string
// APIKey is the resource key, sent as Ocp-Apim-Subscription-Key.
APIKey string
// BearerToken, when set, wins over APIKey: it is called per request and
// the token rides "Authorization: Bearer". Hosts set it for Entra sign-in.
BearerToken speechkit.BearerTokenFunc
// Model is "MAI-Transcribe-2" (default) or "MAI-Transcribe-1.5".
Model string
// Style is "clean" (default; dictation wants readable text) or "verbatim".
Style string
// Timestamps is "none" (default), "segment" or "word".
Timestamps string
// Diarization enables speaker labels for every request. A request can
// also ask for them through TranscribeOpts.Speaker.
Diarization bool
// MaxPhrases caps the phraseList built from keyterms (default 100).
MaxPhrases int
}
Options configures the MAI fast-transcription provider.
type Provider ¶
type Provider struct {
Host string
APIKey string
BearerToken speechkit.BearerTokenFunc
Model string
Style string
Timestamps string
Diarization bool
MaxPhrases int
Validation netsec.ValidationOptions
// contains filtered or unexported fields
}
Provider implements stt.STTProvider for MAI-Transcribe on Azure Speech.
Host is user-supplied configuration and is validated against Validation on every request. The default Validation is strict: only public https hosts are accepted. Tests and hosts pointing at loopback servers relax it.
func (*Provider) Capabilities ¶
func (*Provider) Capabilities() []speechkit.Capability
Capabilities reports the STT baseline plus speaker diarization, which the fast-transcription API does natively.