TranscriptObservationFeed
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:35
An AdapterVoiceObservations feed for providers that report transcript text but no media timestamps. Each fragment id names one utterance: append revises that fragment in place with the text so far, and complete replaces it with the provider’s full text and marks it final, so a final event never duplicates streamed text.
Times are local receipt times in milliseconds since the last
restart. They approximate the connection’s media timeline rather
than measure it. The feed reports no media evidence, so media stays
unknown for its consumers. Adapters remain responsible for dropping
callbacks from a stale connection before they reach the feed.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TranscriptObservationFeed(
options?):TranscriptObservationFeed
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:43
Creates an idle feed whose timeline starts now.
Parameters
Section titled “Parameters”options?
Section titled “options?”TranscriptObservationFeedOptions = {}
Returns
Section titled “Returns”TranscriptObservationFeed
Methods
Section titled “Methods”append()
Section titled “append()”append(
id,role,delta):void
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:73
Appends streamed text to utterance id, publishing the whole text so far
under the same id. Empty deltas and deltas after completion are ignored.
Parameters
Section titled “Parameters”string
"user" | "assistant"
string
Returns
Section titled “Returns”void
complete()
Section titled “complete()”complete(
id,role,text):void
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:97
Revises utterance id to the provider’s full text and marks it final.
An utterance never seen before is published whole, unless its text is
empty, because an empty first report carries no evidence.
Parameters
Section titled “Parameters”string
"user" | "assistant"
string
Returns
Section titled “Returns”void
restart()
Section titled “restart()”restart():
void
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:64
Starts a new connection timeline at zero and forgets every tracked utterance.
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”
readonlysubscribe(handler):Unsubscribe
Defined in: packages/realtime/src/lib/transcript-observation-feed.ts:54
Observes fragments. A throwing handler never affects other handlers or the adapter.
Parameters
Section titled “Parameters”handler
Section titled “handler”(event) => void
Returns
Section titled “Returns”Unsubscribe