Skip to main content

beam_types

beam_types holds the serializable types that cross process boundaries. It has no dependencies on the rest of Riverbeam, so clients and tools can use it on its own.

beam_types = { path = "../riverbeam/crates/beam_types" }

Types​

TypeRole
InvokeRequestAn invocation: agent, content, session, optional ids, stream, actions, auth_context
InvokeAuthContextuser_id, profile_id, org_id (alias organization_id), mcp_token
ChatRequestA text-only request shape: agent_name, message, session_id, metadata, request_id, stream
ContentPart, ContentPartType, ModalityMessage content and its modality; ContentPart::text(..) builds a text part
AgentInputWhat an agent receives: the request plus run_id; modalities() and user_id() helpers
AgentContextHistory, resolved ModelConfig, tools and metadata, built by the pipeline
AgentMetadataAgent name, description, input and output modalities, tags, version
AgentMessage, AgentMessageRole, AgentMessageType, AgentMessagePhaseOne message in a conversation or stream
AgentResult, TokenUsage, ToolCallRecordThe outcome of a run
StreamChunk, StreamChunkTypeOne stream frame
ActionResponseEnvelope, ActionResponseStatusA response to a pending approval
ModelConfig, ModelProviderA model the router can pick

Field-by-field JSON shapes are in Wire types.

Conventions​

  • Empty optional fields and empty metadata objects are left out of the JSON.
  • Enums serialize in lowercase or snake case: "type": "image_url", "role": "ai", "status": "submitted".
  • The repository's tests/wire_compat fixtures check that the JSON round-trips unchanged.