Skip to content

API Reference parrot.integrations.matrix.roost.carrier

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.matrix.roost.carrier

View source

Matrix carrier for Roost (FEAT-747 M12). One carrier among four; body is mandatory.

Alias AgentAddress

Re-exported from parrot.roost.messages.AgentAddress.

Alias Carrier

Re-exported from parrot.roost.carriers.base.Carrier.

Alias CarrierClosed

Re-exported from parrot.roost.carriers.base.CarrierClosed.

Alias CarrierKind

Re-exported from parrot.roost.performatives.CarrierKind.

Alias FailureInfo

Re-exported from parrot.roost.messages.FailureInfo.

Alias Inbound

Re-exported from parrot.roost.carriers.base.Inbound.

Alias InteractionProtocol

Re-exported from parrot.roost.performatives.InteractionProtocol.

Alias LocalEnvelope

Re-exported from parrot.roost.messages.LocalEnvelope.

Class MatrixCarrier

Roost carrier over m.parrot.roost room events.

Parameter Type Default Description
client 'MatrixClientWrapper' Connected Matrix client wrapper.
room_id str Room the carrier speaks in.
agent_name str Name of the local agent (used for logging and self-echo suppression).
render Optional[Callable[[RoostMessage], str]] None Optional RoostMessage -> str producing the mandatory human-readable body.

Method MatrixCarrier.send

Send msg as an m.parrot.roost event in the carrier's room.

send(msg: RoostMessage) -> None

Parameter Type Default Description
msg RoostMessage

Raises:

  • CarrierClosed — The carrier has been closed.
  • ValueError — msg.content is neither JSON, a model nor a handle.

Method MatrixCarrier.subscribe

Register inbound for messages addressed to address or matching capabilities.

subscribe(address: AgentAddress, inbound: Inbound, *, capabilities: Sequence[str] = ()) -> str

Parameter Type Default Description
address AgentAddress
inbound Inbound
capabilities Sequence[str] ()

Returns: str

Method MatrixCarrier.unsubscribe

Deactivate a subscription (the client has no handler-removal API, so a flag is flipped).

unsubscribe(subscription_id: str) -> bool

Parameter Type Default Description
subscription_id str

Returns: bool

Method MatrixCarrier.close

Drop every subscription; later events are ignored.

close() -> None

Method MatrixCarrier.to_content

Build the event content for msg.

to_content(msg: RoostMessage, *, body: str) -> RoostEventContent

Parameter Type Default Description
msg RoostMessage
body str

Returns: RoostEventContent

Raises:

  • ValueError — msg.content is not a model, JSON value or handle.

Method MatrixCarrier.from_content

Rebuild a :class:RoostMessage from event content (event_id is logged for traceability).

from_content(content: Dict[str, Any], *, event_id: str) -> RoostMessage

Parameter Type Default Description
content Dict[str, Any]
event_id str

Returns: RoostMessage

Alias MatrixClientWrapper

Re-exported from parrot.integrations.matrix.client.MatrixClientWrapper.

Alias ParrotEventType

Re-exported from parrot.integrations.matrix.events.ParrotEventType.

Alias Performative

Re-exported from parrot.roost.performatives.Performative.

Alias RoostEventContent

Re-exported from parrot.integrations.matrix.events.RoostEventContent.

Alias RoostMessage

Re-exported from parrot.roost.messages.RoostMessage.

Alias TraceContext

Re-exported from parrot.core.events.lifecycle.TraceContext.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally