pub struct CodeAgent { /* private fields */ }Expand description
Main AI-Native Code Agent
Implementations§
Source§impl CodeAgent
impl CodeAgent
Sourcepub fn new(model: Box<dyn LanguageModel>, config: AgentConfig) -> Self
pub fn new(model: Box<dyn LanguageModel>, config: AgentConfig) -> Self
Create a new agent with the given model and configuration
Sourcepub async fn process_task(
&mut self,
request: &str,
) -> Result<TaskResult, AgentError>
pub async fn process_task( &mut self, request: &str, ) -> Result<TaskResult, AgentError>
Process a task from start to finish
Sourcepub async fn register_tool<T: Tool + 'static>(&mut self, tool: T)
pub async fn register_tool<T: Tool + 'static>(&mut self, tool: T)
Register a tool with the agent
Sourcepub async fn get_tools(&self) -> Arc<Mutex<ToolRegistry>>
pub async fn get_tools(&self) -> Arc<Mutex<ToolRegistry>>
Get the tool registry
Sourcepub fn get_config(&self) -> &AgentConfig
pub fn get_config(&self) -> &AgentConfig
Get the configuration
Sourcepub fn get_model(&self) -> &Box<dyn LanguageModel>
pub fn get_model(&self) -> &Box<dyn LanguageModel>
Get the model
Auto Trait Implementations§
impl Freeze for CodeAgent
impl !RefUnwindSafe for CodeAgent
impl Send for CodeAgent
impl Sync for CodeAgent
impl Unpin for CodeAgent
impl !UnwindSafe for CodeAgent
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