pub struct AgentBuilder<State, M = InMemoryMemory> { /* private fields */ }Expand description
Typestate builder for AgentRunner.
Implementations§
Source§impl<State, M> AgentBuilder<State, M>
impl<State, M> AgentBuilder<State, M>
Sourcepub fn tools(self, tools: ToolRegistry) -> Self
pub fn tools(self, tools: ToolRegistry) -> Self
Replaces the tool registry.
Sourcepub fn memory<NewM>(self, memory: NewM) -> AgentBuilder<State, NewM>
pub fn memory<NewM>(self, memory: NewM) -> AgentBuilder<State, NewM>
Replaces the memory backend.
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Sets the sampling temperature.
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Sets the maximum output tokens.
Sourcepub fn loop_strategy(self, loop_strategy: LoopStrategy) -> Self
pub fn loop_strategy(self, loop_strategy: LoopStrategy) -> Self
Sets the loop strategy.
Source§impl<M> AgentBuilder<NoLlm, M>
impl<M> AgentBuilder<NoLlm, M>
Sourcepub fn llm(self, llm: impl LlmProvider + 'static) -> AgentBuilder<WithLlm, M>
pub fn llm(self, llm: impl LlmProvider + 'static) -> AgentBuilder<WithLlm, M>
Configures the LLM provider and advances the typestate.
Sourcepub fn llm_arc(self, llm: Arc<dyn LlmProvider>) -> AgentBuilder<WithLlm, M>
pub fn llm_arc(self, llm: Arc<dyn LlmProvider>) -> AgentBuilder<WithLlm, M>
Configures a shared LLM provider and advances the typestate.
Source§impl<M> AgentBuilder<WithLlm, M>where
M: Memory,
impl<M> AgentBuilder<WithLlm, M>where
M: Memory,
Sourcepub fn build(self) -> Result<AgentRunner<M>>
pub fn build(self) -> Result<AgentRunner<M>>
Builds the configured agent.
Auto Trait Implementations§
impl<State, M> Freeze for AgentBuilder<State, M>where
M: Freeze,
impl<State, M = InMemoryMemory> !RefUnwindSafe for AgentBuilder<State, M>
impl<State, M> Send for AgentBuilder<State, M>
impl<State, M> Sync for AgentBuilder<State, M>
impl<State, M> Unpin for AgentBuilder<State, M>
impl<State, M> UnsafeUnpin for AgentBuilder<State, M>where
M: UnsafeUnpin,
impl<State, M = InMemoryMemory> !UnwindSafe for AgentBuilder<State, M>
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