Skip to main content

Assembly

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

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)]

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>

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>

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]

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 root(&self) -> &LlmAgent

The root agent.

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]

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 info(&self) -> &[AgentInfo]

What each agent in agents was made from, in the same order.

pub fn remotes(&self) -> &[RemoteInfo]

The remote subagents the files name.

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

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

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§

§

impl Debug for Assembly

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more