Skip to content

bodhi-realtime-agent / TransportAdapter

Interface: TransportAdapter ​

Defined in: src/runtime/adapters/transport-adapter.ts:35

Provider-agnostic adapter interface.

Inbound callbacks (provider → actor): Set by TransportActor.onStart(). Outbound commands (actor → provider): Called by TransportActor.onMessage().

Properties ​

capabilities ​

readonly capabilities: AdapterCapabilities

Defined in: src/runtime/adapters/transport-adapter.ts:39

Static capability flags forwarded from the underlying LLMTransport.


onClosed? ​

optional onClosed?: (reason?) => void

Defined in: src/runtime/adapters/transport-adapter.ts:56

Fires when the transport closes.

Parameters ​

reason? ​

string

Returns ​

void


onError? ​

optional onError?: (error, recoverable) => void

Defined in: src/runtime/adapters/transport-adapter.ts:54

Fires on transport error.

Parameters ​

error ​

string

recoverable ​

boolean

Returns ​

void


onInterrupted? ​

optional onInterrupted?: () => void

Defined in: src/runtime/adapters/transport-adapter.ts:48

Fires when the model's response is interrupted.

Returns ​

void


onSessionReady? ​

optional onSessionReady?: () => void

Defined in: src/runtime/adapters/transport-adapter.ts:44

Fires when the transport session is ready.

Returns ​

void


onToolCallCancelled? ​

optional onToolCallCancelled?: (ids) => void

Defined in: src/runtime/adapters/transport-adapter.ts:52

Fires when the model cancels tool calls.

Parameters ​

ids ​

string[]

Returns ​

void


onToolCallReceived? ​

optional onToolCallReceived?: (calls) => void

Defined in: src/runtime/adapters/transport-adapter.ts:50

Fires when the model emits tool calls.

Parameters ​

calls ​

AdapterToolCall[]

Returns ​

void


onTurnComplete? ​

optional onTurnComplete?: (turnId?) => void

Defined in: src/runtime/adapters/transport-adapter.ts:46

Fires when a model turn completes.

Parameters ​

turnId? ​

string

Returns ​

void

Methods ​

cancelGeneration() ​

cancelGeneration(): void

Defined in: src/runtime/adapters/transport-adapter.ts:67

Cancel the current generation.

Returns ​

void


sendContent() ​

sendContent(content, turnComplete?): void

Defined in: src/runtime/adapters/transport-adapter.ts:61

Send content to the transport.

Parameters ​

content ​

unknown[]

turnComplete? ​

boolean

Returns ​

void


sendToolResult() ​

sendToolResult(id, name, result, scheduling): void

Defined in: src/runtime/adapters/transport-adapter.ts:63

Send a tool result to the transport.

Parameters ​

id ​

string

name ​

string

result ​

unknown

scheduling ​

string

Returns ​

void


transferSession() ​

transferSession(config, state): Promise<void>

Defined in: src/runtime/adapters/transport-adapter.ts:65

Initiate a session transfer.

Parameters ​

config ​

unknown

state ​

unknown

Returns ​

Promise<void>


triggerGeneration() ​

triggerGeneration(): void

Defined in: src/runtime/adapters/transport-adapter.ts:69

Trigger a new generation.

Returns ​

void

Built with VitePress