pub struct AgentBuilder<P: ChatProvide = DeepSeek, M: Memory = SequentialMemory> {
pub llm: ChatModel<P>,
pub config: AgentConfig,
pub memory: M,
pub system_prompt: String,
pub with_skills: Option<PathBuf>,
pub with_builtin_tools: bool,
pub with_subagent: bool,
pub tools: Vec<Box<dyn Tool>>,
pub mcpservers: Vec<(String, Vec<String>)>,
pub mcpconfig_path: Option<PathBuf>,
pub hooks: HookManager,
pub middlewares: MiddlewareManager,
}Fields§
§llm: ChatModel<P>§config: AgentConfig§memory: M§system_prompt: String§with_skills: Option<PathBuf>§with_builtin_tools: bool§with_subagent: bool§tools: Vec<Box<dyn Tool>>§mcpservers: Vec<(String, Vec<String>)>§mcpconfig_path: Option<PathBuf>§hooks: HookManager§middlewares: MiddlewareManagerImplementations§
Source§impl<C: ChatProvide, M: Memory> AgentBuilder<C, M>
impl<C: ChatProvide, M: Memory> AgentBuilder<C, M>
pub async fn build(self) -> AgentResult<Agent<C, M>>
Source§impl<P: ChatProvide> AgentBuilder<P>
impl<P: ChatProvide> AgentBuilder<P>
Source§impl<C: ChatProvide, M: Memory> AgentBuilder<C, M>
impl<C: ChatProvide, M: Memory> AgentBuilder<C, M>
pub fn temperature(self, temperature: f64) -> Self
pub fn max_iteration(self, max_iteration: usize) -> Self
pub fn memory<NM: Memory>(self, memory: NM) -> AgentBuilder<C, NM>
pub fn llm<NC: ChatProvide>(self, llm: ChatModel<NC>) -> AgentBuilder<NC, M>
pub fn system_prompt(self, system_prompt: impl Into<String>) -> Self
pub fn with_skills(self, skill_path: impl Into<PathBuf>) -> Self
pub fn with_builtin_tools(self, enabled: bool) -> Self
pub fn with_tool(self, tool: impl Tool + 'static) -> Self
pub fn with_hook(self, hook: impl Hook + 'static) -> Self
pub fn with_middleware(self, middleware: impl Into<Middleware>) -> Self
pub fn with_llm_out_middleware<LM: LlmOutMiddleware + 'static>( self, middleware: LM, ) -> Self
pub fn with_tool_call_middleware<TM: ToolCallMiddleware + 'static>( self, middleware: TM, ) -> Self
pub fn with_tool_result_middleware<TM: ToolResultMiddleware + 'static>( self, middleware: TM, ) -> Self
pub fn with_tools(self, tools: impl IntoIterator<Item = Box<dyn Tool>>) -> Self
pub fn with_mcpconfig(self, path: impl Into<PathBuf>) -> Self
pub fn with_mcpserver<S1: Into<String>, S2: Into<String>, I: IntoIterator<Item = S2>>( self, cmd: S1, args: I, ) -> Self
Auto Trait Implementations§
impl<P = DeepSeek, M = SequentialMemory> !Freeze for AgentBuilder<P, M>
impl<P = DeepSeek, M = SequentialMemory> !RefUnwindSafe for AgentBuilder<P, M>
impl<P = DeepSeek, M = SequentialMemory> !UnwindSafe for AgentBuilder<P, M>
impl<P, M> Send for AgentBuilder<P, M>
impl<P, M> Sync for AgentBuilder<P, M>
impl<P, M> Unpin for AgentBuilder<P, M>
impl<P, M> UnsafeUnpin for AgentBuilder<P, M>where
M: UnsafeUnpin,
P: UnsafeUnpin,
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