pub struct Agent { /* private fields */ }Expand description
The Agent orchestrates LLM calls and tool execution.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(
llm_client: Arc<LlmClient>,
tools: Arc<ToolRegistry>,
skills: Arc<SkillRegistry>,
frontend: Arc<dyn Frontend>,
context_config: Option<&ContextConfig>,
context_window: Option<u64>,
working_dir: PathBuf,
auto_approve: bool,
extensions: HashMap<String, Arc<dyn Any + Send + Sync>>,
) -> Self
pub fn new( llm_client: Arc<LlmClient>, tools: Arc<ToolRegistry>, skills: Arc<SkillRegistry>, frontend: Arc<dyn Frontend>, context_config: Option<&ContextConfig>, context_window: Option<u64>, working_dir: PathBuf, auto_approve: bool, extensions: HashMap<String, Arc<dyn Any + Send + Sync>>, ) -> Self
Create a new Agent with the given dependencies.
Sourcepub async fn run(self, message_rx: Receiver<FrontendMessage>)
pub async fn run(self, message_rx: Receiver<FrontendMessage>)
Run the agent’s main event loop. Takes ownership of the message receiver. Returns when the channel is closed or user types /exit.
Auto Trait Implementations§
impl !RefUnwindSafe for Agent
impl !UnwindSafe for Agent
impl Freeze for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
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