interface STTOptions {
    agentContext?: string;
    agentContextCarryover?: boolean;
    apiKey?: string;
    baseUrl: string;
    bufferSizeMs: number;
    domain?: string;
    encoding: STTEncoding;
    endOfTurnConfidenceThreshold?: number;
    formatTurns?: boolean;
    inactivityTimeout?: number;
    keytermsPrompt?: string[];
    languageDetection?: boolean;
    maxSpeakers?: number;
    maxTurnSilence?: number;
    minTurnSilence?: number;
    mode?: "min_latency" | "balanced" | "max_accuracy";
    previousContextNTurns?: number;
    prompt?: string;
    sampleRate: number;
    speakerLabels?: boolean;
    speechModel: STTModels;
    vadThreshold?: number;
    voiceFocus?: VoiceFocus;
    voiceFocusThreshold?: number;
}

Properties

agentContext?: string

Only supported with the Universal-3 Pro model family.

agentContextCarryover?: boolean

When the model supports it, let an AgentSession push each assistant reply into agentContext so it is carried into the model's conversation context. Defaults to false; set true to enable. Prior user turns are carried automatically by the model regardless of this flag. Ignored on models without context support.

apiKey?: string
baseUrl: string
bufferSizeMs: number

How large each chunk of audio is before being sent to AssemblyAI, in milliseconds. Corresponds to Python's buffer_size_seconds (seconds there, ms here per this repo's time-unit convention).

domain?: string
encoding: STTEncoding
endOfTurnConfidenceThreshold?: number
formatTurns?: boolean
inactivityTimeout?: number

Session inactivity timeout in seconds. AssemblyAI accepts integer values from 5 to 3600; when unset, no inactivity timeout is applied.

keytermsPrompt?: string[]
languageDetection?: boolean
maxSpeakers?: number
maxTurnSilence?: number

Maximum silence (ms) before end-of-turn is forced regardless of confidence.

minTurnSilence?: number

Minimum silence (ms) before a confident end-of-turn is finalized.

mode?: "min_latency" | "balanced" | "max_accuracy"

Accuracy/latency preset for the Universal-3 Pro model family: min_latency, balanced, or max_accuracy. Explicit turn-silence values still take precedence over mode defaults.

previousContextNTurns?: number

Only supported with the Universal-3 Pro model family. Set at connection time only.

prompt?: string

Only supported with the Universal-3 Pro model family.

sampleRate: number
speakerLabels?: boolean

Enable speaker diarization. Note: AssemblyAI will return per-word speaker labels, but the JS framework's stt.SpeechData type does not yet expose a speakerId field (unlike the Python framework), so the labels are not currently surfaced on emitted events. Setting this to true still has effect server-side. Once the base SpeechData interface gains speaker support, #processStreamEvent should forward data.words[].speaker too.

speechModel: STTModels
vadThreshold?: number
voiceFocus?: VoiceFocus

Isolate the primary voice and suppress background noise. Connect-time only.

voiceFocusThreshold?: number

Background audio suppression aggressiveness, from 0.0 to 1.0. Connect-time only.