pub struct AgentBuilder { /* private fields */ }Expand description
Builder for creating agents
Implementations§
Source§impl AgentBuilder
impl AgentBuilder
Sourcepub fn with_tools(self, tools: Vec<Box<dyn Tool>>) -> Self
pub fn with_tools(self, tools: Vec<Box<dyn Tool>>) -> Self
Add multiple tools
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set system prompt
Sourcepub fn with_max_iterations(self, max: usize) -> Self
pub fn with_max_iterations(self, max: usize) -> Self
Set max iterations
Sourcepub fn with_conversation_mode(self, mode: ConversationMode) -> Self
pub fn with_conversation_mode(self, mode: ConversationMode) -> Self
Set conversation mode
Sourcepub fn with_max_conversation_length(self, length: usize) -> Self
pub fn with_max_conversation_length(self, length: usize) -> Self
Set max conversation length
Sourcepub fn with_memory(self, memory_config: MemoryConfig) -> Self
pub fn with_memory(self, memory_config: MemoryConfig) -> Self
Set memory configuration (enables persistent memory)
Sourcepub fn build(self) -> RragResult<Agent>
pub fn build(self) -> RragResult<Agent>
Build the agent
Trait Implementations§
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