Struct Assembly
pub struct Assembly { /* private fields */ }Expand description
The agents an AgentDef makes: the root and one LlmAgent for each
local subagent definition, ready to register on a runtime.
A subagent is an agent of its own, registered under <parent>/<name> with its own prompt,
tools, skills, model alias and limits, and it inherits nothing from its parent: not the tools
(a subagent with no tools: has none), not the skills, not the history. Its parent gets one
tool named after it (SubagentTool) whose call starts the subagent as a
durable child run on the runtime that steps the parent, so every agent of the assembly must
be registered on that runtime, which register does.
Implementations§
§impl Assembly
impl Assembly
pub fn session_limits(&self) -> SessionLimits
pub fn session_limits(&self) -> SessionLimits
The limits the root’s sessions run under: the deployment’s
(AgentDef::session_limits) lowered by the root’s file.
pub fn session_bounds(&self) -> &[(String, SessionBounds)]
pub fn session_bounds(&self) -> &[(String, SessionBounds)]
The bounds of each subagent the root may start a session on (ADR 0054 decision 2), by the
name the model writes in agent, in the order of the root’s manifest: what the five
session tools’ [SessionBounds::admit] holds a subagent_start’s config to. Each is
what the subagent’s folder declares, narrowed by what the deployment allows; read from the
SessionTools the root was built with, so a card and a client see what the tool enforces.
Empty when the root has no subagent.
pub fn agent_modes(&self) -> Option<AgentModes>
pub fn agent_modes(&self) -> Option<AgentModes>
The modes the root agent declares (agent-mode/v1, ADR 0039 decision 3), as the card lists
them and the A2A front refuses a message for: None when the folder has no modes/. What
the source narrows is the same set, so the card and the run cannot disagree.
pub fn child_sessions(&self) -> Option<&ChildSessions>
pub fn child_sessions(&self) -> Option<&ChildSessions>
What the root’s A2A front serves child-sessions/v1 for, as
AgentDef::child_sessions computed it when the
definition was bound: None when the root has no subagent. Only with the feature sessions (which a2a turns on).
pub fn agents(&self) -> &[LlmAgent]
pub fn agents(&self) -> &[LlmAgent]
Every agent, the root first and then each subagent (depth first, in name order). What
Runtime::builder(..).agent(a) takes, one by one; register does the
loop.
pub fn register(&self, builder: RuntimeBuilder) -> RuntimeBuilder
pub fn register(&self, builder: RuntimeBuilder) -> RuntimeBuilder
Register every agent on a runtime builder: the root and each subagent. A subagent tool
starts its child on the runtime that steps the parent, and finds it by the name it is
registered under, so there is no handle to attach and nothing to forget: what registers the
agents makes the tools work. A runtime that steps the root but does not know a subagent
(a process that registered assembly.root() alone) refuses the call for good, and the model
sees an error result naming the missing agent. In a split deployment, register the
subagents as starters on the process that steps the parent.
pub fn remote_round_agents(&self) -> &[RemoteRoundAgent]
pub fn remote_round_agents(&self) -> &[RemoteRoundAgent]
The agents that work the rounds of a session on a remote subagent of the root, registered
as <root>/<subagent>: register registers them with the rest. A
composition root that registers agents one by one registers these too, or
subagent_start on a remote subagent is refused in a process that does not know the name.
Only with the feature remote.
pub fn remotes(&self) -> &[RemoteInfo]
pub fn remotes(&self) -> &[RemoteInfo]
The remote subagents the files name.
pub fn prompt_commands(&self) -> &[PromptCommand]
pub fn prompt_commands(&self) -> &[PromptCommand]
The prompts of the root agent’s MCP servers as commands named <server>__<prompt>
(commands/v1), read once when the servers were connected. A subagent’s servers give none:
commands are the root’s. A server with a bearer per call, or with prompts: false, gives
none. Only with the feature mcp.
pub fn manifest(&self) -> &AgentManifest
pub fn manifest(&self) -> &AgentManifest
The manifest the root agent was made from: its skills, mcp.json and schedules (the
skills and the MCP servers are bound; schedules are for a later slice).
§impl Assembly
impl Assembly
pub fn card(
&self,
url: Url,
version: impl Into<String>,
) -> Result<AgentCardConfig, Error>
pub fn card( &self, url: Url, version: impl Into<String>, ) -> Result<AgentCardConfig, Error>
The root agent’s card: as an [AgentCardConfig], ready for
A2aServer::router.
The frontmatter holds what describes the agent: card.name (default: the agent’s name),
card.description (default: the frontmatter description) and card.skills. What
belongs to the deployment is not in a file: url is where clients reach the server and
version is the agent’s own version (env!("CARGO_PKG_VERSION"), or
adam_a2a::build_version(..) of it to carry the build’s revision as build metadata: ADR 0028). A2A card
skills are what the agent offers to callers; they are unrelated to Agent Skills.
§Errors
Error::MissingCardDescription when neither the card nor the agent has a description.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Assembly
impl !UnwindSafe for Assembly
impl Freeze for Assembly
impl Send for Assembly
impl Sync for Assembly
impl Unpin for Assembly
impl UnsafeUnpin for Assembly
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].