Skip to content

Channel Models

ChannelBinding

Bases: BaseModel

A channel's attachment to a room.

sends property

sends

Whether the binding's direction delivers to the outside (RFC §4.2): a transport is delivered to only when it sends. Every binding that reads still receives through on_event().

can_write property

can_write

RFC §7.5 — whether this binding may write events into the room.

True iff the binding has write access (READ_WRITE or WRITE_ONLY) and is not muted. Gates both direct injection into the timeline (inbound pipeline) and source broadcast (event router).

ChannelCapabilities

Bases: BaseModel

What a channel can do.

supported_media_types class-attribute instance-attribute

supported_media_types = Field(default_factory=list)

The MIME types of the files the channel takes (RFC §5.8); empty takes every type. A file of another type is delivered as its text form (§6.6).

max_media_size_bytes class-attribute instance-attribute

max_media_size_bytes = Field(default=None, gt=0)

The largest file the channel takes; a file of known size over it is delivered as its text form (RFC §5.8, §6.6). None: any size.

ChannelOutput

Bases: BaseModel

Output produced by a channel after receiving an event.

provider_result class-attribute instance-attribute

provider_result = None

Native result of a transport delivery attempt.

Transport channels preserve it here so the framework can report provider message ids and metadata without overloading AI response metadata.

metadata_updates class-attribute instance-attribute

metadata_updates = Field(default_factory=dict)

Keys the framework writes on the room's metadata once the delivery set has run, merged with the other targets' in the order they answered, on_event()'s and deliver()'s alike (RFC §10.1 step 15). A key only the framework writes, under roomkit: or of the room's private state (author_register), is dropped with a warning, the rest applied.

error class-attribute instance-attribute

error = Field(default=None, exclude=True)

An error the channel met while producing this output.

The output is still delivered (an AI turn the provider interrupted after a tool round keeps its rounds, RFC §6.4), and the error surfaces as for a channel that raised: ON_ERROR fires and the caller's InboundResult.error carries it.

empty classmethod

empty()

Create an empty output with no responses or side effects.

RateLimit

Bases: BaseModel

Rate limiting configuration for a channel.

RetryPolicy

Bases: BaseModel

Configures retry behaviour for channel delivery.

retryable_errors class-attribute instance-attribute

retryable_errors = None

Exception type names that may be retried (RFC §13.2).

None retries anything the error itself does not refuse — a provider that marks its exception retryable=False is believed either way, which is how a permanent 4xx stops being replayed with full backoff. Naming types here narrows it further: only those are retried, everything else fails on its first attempt.