pub struct AgentBuilder<I, O> { /* private fields */ }Expand description
Startup-only builder for one immutable, strongly typed agent definition.
The builder generates explicit JSON Schema 2020-12 documents using the
serialization contract of I and deserialization contract of O. It then
digest-pins those documents into the ordinary provider-neutral
AgentDescriptor. No execution or persistence boundary is bypassed.
Implementations§
Source§impl<I, O> AgentBuilder<I, O>
impl<I, O> AgentBuilder<I, O>
Sourcepub fn new(
metadata: CapabilityMetadata,
input_schema_id: SchemaId,
output_schema_id: SchemaId,
model: ModelDescriptor,
instructions: AgentInstructions,
execution: AgentExecutionConfig,
) -> Self
pub fn new( metadata: CapabilityMetadata, input_schema_id: SchemaId, output_schema_id: SchemaId, model: ModelDescriptor, instructions: AgentInstructions, execution: AgentExecutionConfig, ) -> Self
Creates a builder with no ordinary tools, no agent-local budget layer, and the standard bounded-JSON input limits.
Sourcepub fn with_tools(self, tools: AgentTools) -> Self
pub fn with_tools(self, tools: AgentTools) -> Self
Installs the exact ordinary-tool descriptor snapshots exposed by the agent.
Sourcepub fn with_budget_limits(self, budget_limits: BudgetLimits) -> Self
pub fn with_budget_limits(self, budget_limits: BudgetLimits) -> Self
Adds an immutable agent-level budget layer.
Sourcepub const fn with_input_json_limits(self, limits: JsonLimits) -> Self
pub const fn with_input_json_limits(self, limits: JsonLimits) -> Self
Selects validated resource ceilings for typed input serialization.
Source§impl<I, O> AgentBuilder<I, O>where
I: JsonSchema,
O: JsonSchema,
impl<I, O> AgentBuilder<I, O>where
I: JsonSchema,
O: JsonSchema,
Sourcepub fn build(self) -> Result<TypedAgentDefinition<I, O>, AgentBuilderError>
pub fn build(self) -> Result<TypedAgentDefinition<I, O>, AgentBuilderError>
Generates, bounds, canonicalizes, and digest-pins both typed schemas, then constructs the ordinary immutable agent descriptor.
§Errors
Returns AgentBuilderError for ambiguous schema identity, schema
generation/resource failure, or an incoherent agent descriptor.
Trait Implementations§
Auto Trait Implementations§
impl<I, O> Forget for AgentBuilder<I, O>
impl<I, O> Freeze for AgentBuilder<I, O>
impl<I, O> Move for AgentBuilder<I, O>
impl<I, O> RefUnwindSafe for AgentBuilder<I, O>
impl<I, O> Send for AgentBuilder<I, O>
impl<I, O> Sync for AgentBuilder<I, O>
impl<I, O> Unpin for AgentBuilder<I, O>
impl<I, O> UnsafeUnpin for AgentBuilder<I, O>
impl<I, O> UnwindSafe for AgentBuilder<I, O>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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