Skip to content

Interface: SttCallbacks

Defined in: types.ts:53

Methods

onDelta()

onDelta(segment, cumulativeText): void

Defined in: types.ts:61

A partial transcript for segment — CUMULATIVE text, not a raw delta. Every engine re-sends the whole running text, so a partial that gets shorter is the vendor revising itself, not data loss. Fires from the moment the model starts transcribing — while the segment's audio is still streaming, before its commit.

Parameters

segment

number

cumulativeText

string

Returns

void


onDiagnostic()?

optional onDiagnostic(event): void

Defined in: types.ts:71

Optional protocol observability — see SttDiagnostic.

Parameters

event

SttDiagnostic

Returns

void


onError()

onError(message, segment?): void

Defined in: types.ts:69

A failure. segment names the committed segment it belongs to (so the caller can settle just that one loudly); undefined for a session-wide fault before any commit.

Parameters

message

string

segment?

number

Returns

void


onFinal()

onFinal(segment, result): void

Defined in: types.ts:63

The final transcript for segment. Fires exactly once per committed segment.

Parameters

segment

number

result

SttFinal

Returns

void