pub struct AgentBuilder { /* private fields */ }Expand description
Fluent builder for creating agents
Implementations§
Source§impl AgentBuilder
impl AgentBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set agent description
Sourcepub fn instruction(self, instruction: impl Into<String>) -> Self
pub fn instruction(self, instruction: impl Into<String>) -> Self
Set system instruction
Sourcepub fn model(self, model: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
Set model by name (uses default provider based on model name)
Sourcepub fn model_config(self, config: ModelConfig) -> Self
pub fn model_config(self, config: ModelConfig) -> Self
Set full model configuration
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set temperature
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Set max output tokens
Sourcepub fn tools(self, tools: impl IntoIterator<Item = Tool>) -> Self
pub fn tools(self, tools: impl IntoIterator<Item = Tool>) -> Self
Add multiple tools
Sourcepub fn sub_agents(self, agents: impl IntoIterator<Item = Agent>) -> Self
pub fn sub_agents(self, agents: impl IntoIterator<Item = Agent>) -> Self
Add multiple sub-agents
Sourcepub fn output_key(self, key: impl Into<String>) -> Self
pub fn output_key(self, key: impl Into<String>) -> Self
Set output key for pipeline state
Sourcepub fn max_iterations(self, max: u32) -> Self
pub fn max_iterations(self, max: u32) -> Self
Set max iterations (for loop agents)
Trait Implementations§
Source§impl Default for AgentBuilder
impl Default for AgentBuilder
Source§fn default() -> AgentBuilder
fn default() -> AgentBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentBuilder
impl RefUnwindSafe for AgentBuilder
impl Send for AgentBuilder
impl Sync for AgentBuilder
impl Unpin 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