pub struct AgentBuilder { /* private fields */ }Implementations§
Source§impl AgentBuilder
impl AgentBuilder
pub fn model(self, model: impl Into<String>) -> Self
pub fn temperature(self, t: f32) -> Self
pub fn max_tokens(self, mt: u32) -> Self
pub fn reasoning_effort(self, effort: ReasoningEffort) -> Self
Sourcepub fn instructions(self, text: impl Into<String>) -> Self
pub fn instructions(self, text: impl Into<String>) -> Self
Set agent-level instructions (system prompt). These will be injected on each step.
pub fn instruction_provider( self, provider: Arc<dyn LLMInstructionProvider>, ) -> Self
pub fn tool(self, tool: ToolDef) -> Self
pub fn tools(self, tools: Vec<ToolDef>) -> Self
pub fn policy(self, policy: CompositePolicy) -> Self
Sourcepub fn handoff_policy(self, policy: AnyHandoffPolicy) -> Self
pub fn handoff_policy(self, policy: AnyHandoffPolicy) -> Self
Enable handoff-aware tool interception and advertise handoff tools
Sourcepub fn with_provider<P>(self, provider: P) -> Self
pub fn with_provider<P>(self, provider: P) -> Self
Override the non-streaming provider (useful for testing with a fixed/mocked model)
Sourcepub fn parallel_tools(self, enabled: bool) -> Self
pub fn parallel_tools(self, enabled: bool) -> Self
Enable or disable parallel tool execution within a step
Sourcepub fn tool_concurrency_limit(self, limit: usize) -> Self
pub fn tool_concurrency_limit(self, limit: usize) -> Self
Set an optional concurrency limit for parallel tool execution
Sourcepub fn tool_join_policy(self, policy: ToolJoinPolicy) -> Self
pub fn tool_join_policy(self, policy: ToolJoinPolicy) -> Self
Configure how parallel tool errors are handled (fail fast or join all)
Sourcepub fn map_agent_service<F>(self, f: F) -> Self
pub fn map_agent_service<F>(self, f: F) -> Self
Optional: wrap the final built agent service with a custom function. This enables applying Tower layers at the agent boundary.
Sourcepub fn auto_compaction(self, policy: CompactionPolicy) -> Self
pub fn auto_compaction(self, policy: CompactionPolicy) -> Self
Enable auto-compaction with the specified policy
pub fn build(self) -> AgentSvc
Auto Trait Implementations§
impl Freeze for AgentBuilder
impl !RefUnwindSafe for AgentBuilder
impl Send for AgentBuilder
impl !Sync for AgentBuilder
impl Unpin for AgentBuilder
impl UnsafeUnpin for AgentBuilder
impl !UnwindSafe for AgentBuilder
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
Mutably borrows from an owned value. Read more
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>
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 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>
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