Skip to main content

AgentRuntimeBuilder

Struct AgentRuntimeBuilder 

Source
pub struct AgentRuntimeBuilder { /* private fields */ }
Expand description

Holds agent runtime builder application-layer state or configuration. Use it with the documented coordinator methods; run, journal, event, provider, or port effects are called out on those methods rather than on construction.

Implementations§

Source§

impl AgentRuntimeBuilder

Source

pub fn providers(self, providers: ProviderRegistry) -> Self

Returns an updated value with providers configured. This stores a provider registry in the builder and performs no provider calls.

Source

pub fn provider<P>( self, route_id: impl Into<String>, provider: P, ) -> Result<Self, AgentError>
where P: ProviderAdapter + 'static,

Returns an updated value with provider configured. This adds one provider adapter to the builder registry and performs no provider calls.

Source

pub fn package_resolver<R>(self, resolver: R) -> Self
where R: RuntimePackageResolver + 'static,

Returns an updated value with package resolver configured. This is builder configuration only; it stores the resolver for future run starts and performs no I/O.

Source

pub fn default_package_id(self, package_id: RuntimePackageId) -> Self

Returns an updated value with default package id configured. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.

Source

pub fn package(self, package: RuntimePackage) -> Self

Returns an updated value with package configured. This reads or configures runtime state without executing a provider or tool.

Source

pub fn default_package(self, package: RuntimePackage) -> Self

Returns an updated value with default package configured. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.

Source

pub fn journal<J>(self, journal: J) -> Self
where J: RunJournal + 'static,

Returns an updated value with journal configured. This reads or configures runtime state without executing a provider or tool.

Source

pub fn event_bus<E>(self, event_bus: E) -> Self
where E: AgentEventBus + 'static,

Returns an updated value with event bus configured. This stores the event-bus port in the builder and does not publish events.

Source

pub fn content<C>(self, content: C) -> Self
where C: ContentResolver + Send + Sync + 'static,

Returns an updated value with content configured. This reads or configures runtime state without executing a provider or tool.

Source

pub fn policy<P>(self, policy: P) -> Self
where P: RuntimePolicyPort + 'static,

Returns policy for the current value. This is a read-only or data-construction helper unless the method body explicitly calls a port or store.

Source

pub fn output_sink<S>(self, sink: S) -> Result<Self, AgentError>
where S: OutputSinkPort + 'static,

Returns output sink for the current value. This is a read-only or data-construction helper unless the method body explicitly calls a port or store.

Source

pub fn tool_route(self, route: ToolRoute) -> Self

Adds one tool route to the runtime’s app-facing tool execution configuration. The route is validated against the effective runtime package only when a model-requested tool call is lowered.

Source

pub fn tool_routes(self, routes: impl IntoIterator<Item = ToolRoute>) -> Self

Replaces the runtime’s configured tool routes. This is builder configuration only and does not execute or resolve tools.

Source

pub fn tool_executors(self, executors: ToolExecutorRegistry) -> Self

Replaces the runtime’s configured tool executor registry. This is builder configuration only and does not execute tools.

Source

pub fn tool_executor( self, executor: Arc<dyn ToolExecutor>, ) -> Result<Self, AgentError>

Adds one tool executor to the runtime’s configured executor registry. This stores the executor behind the public port and does not execute it.

Source

pub fn tool_policy<P>(self, policy: P) -> Self
where P: ToolPolicyPort + 'static,

Configures the runtime’s tool policy port. This is builder configuration only and does not evaluate policy.

Source

pub fn approval_dispatcher<D>(self, dispatcher: D) -> Self
where D: ApprovalDispatcher + 'static,

Configures the host-owned approval dispatcher used by approval-gated tool execution.

Source

pub fn shared_approval_dispatcher( self, dispatcher: Arc<dyn ApprovalDispatcher>, ) -> Self

Configures a shared host-owned approval dispatcher.

Source

pub fn hook_executor_registry<R>(self, registry: R) -> Self
where R: HookExecutorRegistry + 'static,

Returns hook executor registry for the current value. This stores the registry for future run starts and hook invocation; it does not invoke hook executors.

Source

pub fn build(self) -> Result<AgentRuntime, AgentError>

Finishes builder validation and returns the configured value. This is data-only unless the surrounding builder explicitly documents adapter or store access.

Trait Implementations§

Source§

impl Default for AgentRuntimeBuilder

Source§

fn default() -> AgentRuntimeBuilder

Returns the “default value” for a type. 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.

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> Same for T

Source§

type Output = T

Should always be Self
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.