Skip to content

bodhi-realtime-agent / TranscriptSink

Interface: TranscriptSink ​

Defined in: src/core/transcript-manager.ts:4

Callbacks fired by TranscriptManager when transcript state changes.

Methods ​

addAssistantMessage() ​

addAssistantMessage(text): void

Defined in: src/core/transcript-manager.ts:13

Record a finalized assistant message in conversation context.

Parameters ​

text ​

string

Returns ​

void


addUserMessage() ​

addUserMessage(text): void

Defined in: src/core/transcript-manager.ts:11

Record a finalized user message in conversation context.

Parameters ​

text ​

string

Returns ​

void


reserveUserMessage()? ​

optional reserveUserMessage(text): string

Defined in: src/core/transcript-manager.ts:17

Hold an ordered slot for a user message whose authoritative transcript is still in flight; returns the id to seal it with. Optional — sinks without it always get plain addUserMessage.

Parameters ​

text ​

string

Returns ​

string


sealUserMessage()? ​

optional sealUserMessage(id, text?): boolean

Defined in: src/core/transcript-manager.ts:19

Resolve a reserved slot, replacing its text when text is non-empty.

Parameters ​

id ​

string

text? ​

string

Returns ​

boolean


sendToClient() ​

sendToClient(msg): void

Defined in: src/core/transcript-manager.ts:9

Send a JSON message to the connected client (partial or final transcript). Implement it as (msg: CoreServerToClientMessage) => void or as (msg: Record<string, unknown>) => void: every frame sent is a core frame that is also a plain JSON object, so both shapes are accepted.

Parameters ​

msg ​

CoreServerToClientMessage & Record<string, unknown>

Returns ​

void

Built with VitePress