Documentation
¶
Index ¶
- Constants
- type Provider
- func (*Provider) Capabilities() []speechkit.Capability
- func (p *Provider) EnableStreamingLLM(model, prompt string, maxTokens int)
- func (p *Provider) Health(ctx context.Context) error
- func (p *Provider) Name() string
- func (p *Provider) StartDictationStream(ctx context.Context, opts speechkit.DictationStreamOptions, ...) (speechkit.DictationStream, error)
- 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)
- func (p *Provider) Warm(ctx context.Context) error
- type StreamingLLM
Constants ¶
const DefaultTurnCleanupPrompt = "" /* 164-byte string literal not displayed */
DefaultTurnCleanupPrompt asks the gateway to tidy a single turn without summarizing. {{turn}} is substituted by AssemblyAI.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
APIKey string
Models []string
StreamingModel string
BaseURL string
StreamingBaseURL string
// SyncBaseURL points at the synchronous transcription endpoint
// (https://sync.assemblyai.com; regional variants sync.us / sync.eu
// exist). The Sync API returns a finished Universal-3.5 Pro transcript
// in one request/response (~134 ms p50) for clips up to 120 s / 40 MB —
// the low-latency dictation path. Empty uses the global endpoint.
SyncBaseURL string
// SyncModel is the X-AAI-Model routing header value for sync requests.
// Empty uses universal-3-5-pro.
SyncModel string
// DisableSync forces every transcription through the classic async
// upload+poll flow, even for clips the Sync API could serve.
DisableSync bool
// StreamingLLM, when set, attaches AssemblyAI LLM Gateway to Universal-3.5
// Pro realtime turns. The formatted transcript still arrives as Turn;
// LLMGatewayResponse may rewrite the final text for live cleanup.
StreamingLLM *StreamingLLM
Validation netsec.ValidationOptions
PollInterval time.Duration
PollTimeout time.Duration
// contains filtered or unexported fields
}
Provider transcribes through AssemblyAI.
func New ¶
New creates an AssemblyAI provider. models is the comma-separated model list; empty uses the provider default.
func (*Provider) Capabilities ¶ added in v0.64.3
func (*Provider) Capabilities() []speechkit.Capability
Capabilities reports what this provider does beyond plain transcription: besides separating voices it attributes them to caller-supplied names or roles.
func (*Provider) EnableStreamingLLM ¶ added in v0.64.3
EnableStreamingLLM attaches LLM Gateway cleanup to realtime dictation.
func (*Provider) StartDictationStream ¶ added in v0.64.3
func (p *Provider) StartDictationStream(ctx context.Context, opts speechkit.DictationStreamOptions, format speaker.AudioFormat) (speechkit.DictationStream, error)
StartDictationStream opens a Universal-3.5 Pro realtime session for live dictation partials. DictationStreamOptions.PromptHint rides as agent_context — the "minimal situational info" (domain, audience, locale hints) the model conditions on from the first frame; finalized user turns are carried forward by the provider automatically. Finalize sends Terminate: the provider flushes the trailing turn, emits Termination, and closes the socket (Receive then returns io.EOF), which matches SpeechKit's one-provider-stream-per-segment model.
func (*Provider) StartSpeakerStream ¶ added in v0.64.3
func (p *Provider) StartSpeakerStream(ctx context.Context, opts speaker.Options, format speaker.AudioFormat) (speaker.SpeakerStream, error)
func (*Provider) Transcribe ¶ added in v0.64.3
func (*Provider) Warm ¶ added in v0.64.3
Warm pre-establishes the HTTPS connection to the Sync API (DNS, TCP, TLS) so the subsequent /transcribe request skips connection setup. Hosts should call it when recording starts; the endpoint is unauthenticated and safe to call repeatedly, and idle connections are evicted after seconds to minutes, so warm close to the transcription rather than at startup.
type StreamingLLM ¶
StreamingLLM is the LLM Gateway payload attached to a realtime dictation WebSocket. Model IDs are LLM Gateway catalog names, not STT names.