pub struct Agent<P: ChatProvide, M: Memory> {
pub config: AgentConfig,
pub llm: ChatModel<P>,
pub memory: M,
pub context_builder: ContextBuilder,
pub toolbox: ToolBox,
pub hooks: HookManager,
pub middlewares: MiddlewareManager,
}Fields§
§config: AgentConfig§llm: ChatModel<P>§memory: M§context_builder: ContextBuilder§toolbox: ToolBox§hooks: HookManager§middlewares: MiddlewareManagerImplementations§
Source§impl<C: ChatProvide, M: Memory> Agent<C, M>
impl<C: ChatProvide, M: Memory> Agent<C, M>
pub fn tool_list(&self) -> &[ToolDefinition]
pub fn system_prompt(&self) -> &str
pub async fn run(&mut self, query: &str) -> AgentResult<AgentControl<String>>
pub async fn chat(&mut self, query: &str) -> AgentResult<AgentControl<String>>
Auto Trait Implementations§
impl<P, M> !Freeze for Agent<P, M>
impl<P, M> !RefUnwindSafe for Agent<P, M>
impl<P, M> !UnwindSafe for Agent<P, M>
impl<P, M> Send for Agent<P, M>
impl<P, M> Sync for Agent<P, M>
impl<P, M> Unpin for Agent<P, M>
impl<P, M> UnsafeUnpin for Agent<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