Skip to content

TranscriptionResult

Result of a speech-to-text transcription.

Defined in: src/core/types/providers.ts:225

Result of a speech-to-text transcription.

Remarks

Represents a transcription result emitted by an STT provider. The result can be interim (partial, still being refined) or final. For providers like Deepgram that support multi-segment utterances, additional flags (speechFinal, isPreflight) indicate when the complete utterance is finished and when speculative processing can begin.

Example

sttProvider.onTranscription((result: TranscriptionResult) => {
  if (result.isPreflight) {
    console.log('Preflight:', result.text);
  } else if (result.speechFinal) {
    console.log('Final utterance:', result.text);
  } else if (result.isFinal) {
    console.log('Segment final:', result.text);
  } else {
    console.log('Interim:', result.text);
  }
});

See

  • RestSTTProvider.onTranscription for registering transcription callbacks
  • LiveSTTProvider.onTranscription for registering transcription callbacks
  • TranscriptionFinalEvent for the corresponding SDK event

Properties

PropertyTypeDescriptionDefined in
confidence?numberConfidence score for the transcription, from 0 (lowest) to 1 (highest). Remarks Not all providers supply confidence scores. When unavailable, this is undefined.src/core/types/providers.ts:292
isFinalbooleanWhether this is a final transcription segment or an interim (partial) result. Remarks Interim results update as the user speaks and are replaced by subsequent results. Final results represent a committed segment of the transcription.src/core/types/providers.ts:236
isPreflight?booleanWhether this is a preflight/eager-end-of-turn signal. Remarks DeepgramFlux (e.g., flux-general-en) can emit this before speech_final to allow the next pipeline stage (LLM) to start generating speculatively. The text may still change slightly when the confirmed speech_final arrives. See - EagerLLMConfig for enabling speculative generation - TranscriptionPreflightEvent for the corresponding SDK eventsrc/core/types/providers.ts:284
metadata?Record<string, unknown>Additional provider-specific metadata. Remarks May contain information such as word-level timestamps, speaker diarization data, or other provider-specific fields.src/core/types/providers.ts:301
speechFinal?booleanWhether this result marks the end of a complete utterance. Remarks For Deepgram: true when speech_final=true (the speaker has stopped talking). For NativeSTT and other providers that emit one result per utterance: equals isFinal. Multi-segment providers (Deepgram) may emit several isFinal: true chunks for a single utterance — only the last one has speechFinal: true. Deprecated Use utteranceComplete instead. This field is retained for informational/display purposes but is no longer used by CompositeVoice to trigger LLM processing.src/core/types/providers.ts:252
textstringThe transcribed text.src/core/types/providers.ts:227
utteranceComplete?booleanWhether this result should trigger the next pipeline stage (LLM). Remarks This is the single flag CompositeVoice checks to decide when to send transcribed text to the LLM. The STT provider is responsible for setting this — it knows its own end-of-utterance semantics. - DeepgramSTT: true when speech_final=true (after buffering all is_final segments into a complete utterance). - NativeSTT: true when isFinal=true (one result per utterance). - AssemblyAI: true on FinalTranscript messages. - ElevenLabs: true on committed_transcript / final_transcript. If not set, CompositeVoice will NOT trigger LLM processing for this result.src/core/types/providers.ts:270

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency