bodhi-realtime-agent / SessionClientSender
Interface: SessionClientSender
Defined in: src/types/session-client.ts:12
Contract for sending data to one client. The server owns the socket and implements this; VoiceSession sends audio and JSON through it. Input is fed via feedAudioFromClient / feedJsonFromClient.
Messages are typed against the client-protocol contract: core frames plus any extension frames registered via ClientProtocolServerExtensions (module augmentation in app or peer code). An unregistered frame fails to compile at the call site.
Properties
supportsPlaybackStateProtocol?
optionalsupportsPlaybackStateProtocol?:boolean
Defined in: src/types/session-client.ts:21
True only when this sender implements ordered sendJsonAfterAudio AND renders assistant audio through the buffered-PCM path. Absent = false.
Methods
sendAudio()
sendAudio(
data):void
Defined in: src/types/session-client.ts:13
Parameters
data
Buffer
Returns
void
sendJson()
sendJson(
message):void
Defined in: src/types/session-client.ts:14
Parameters
message
AnyServerToClientMessage
Returns
void
sendJsonAfterAudio()?
optionalsendJsonAfterAudio(message):void
Defined in: src/types/session-client.ts:18
Send a JSON message in delivery order after the turn's audio bytes — used by the playback-state protocol so audio.done cannot overtake buffered audio. Optional; a sender that omits it does not participate.
Parameters
message
AnyServerToClientMessage
Returns
void