Channel ABC¶
Channel ¶
Bases: ABC
Base class for all channels.
supports_streaming_delivery
property
¶
Whether this channel can accept streaming text delivery.
on_trace ¶
Register a protocol trace observer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
TraceCallback
|
Called with each :class: |
required |
protocols
|
list[str] | None
|
Optional allowlist of protocol names (e.g.
|
None
|
resolve_trace_room ¶
Resolve a room ID for a trace with the given session.
Override in session-based channels (voice, realtime voice) to
map session IDs to room IDs. Returns None by default.
handle_inbound
abstractmethod
async
¶
Process an inbound message into a RoomEvent.
on_event
async
¶
React to an event. Default: no-op for transport channels.
deliver_stream
async
¶
Deliver a streaming text response to this channel.
Default: accumulate text, deliver as complete event.
connect_session
async
¶
Accept a long-lived session after inbound processing.
Called by process_inbound when message.session is present
and hooks did not block. Override in session-based channels
(voice, persistent WebSocket, etc.). Default: no-op.
disconnect_session
async
¶
Clean up a session on remote disconnect.
Override in session-based channels to release resources. Default: no-op.
update_binding ¶
Notify the channel that a room's binding has changed.
Called by the framework after mute(), unmute(), or
set_access() update the store. Override in session-based
channels (voice, realtime voice) to update cached binding state
used for audio gating. Default: no-op.