pub struct Agent {
pub messages: Vec<ChatMessage>,
pub max_steps: usize,
pub token_limit: usize,
pub completion_reserve: usize,
pub workspace: PathBuf,
/* private fields */
}Fields§
§messages: Vec<ChatMessage>§max_steps: usize§token_limit: usize§completion_reserve: usize§workspace: PathBufImplementations§
Source§impl Agent
impl Agent
pub fn new( llm: LlmClient, system_prompt: String, tools: Vec<Arc<dyn Tool>>, max_steps: usize, token_limit: usize, completion_reserve: usize, workspace_dir: PathBuf, retry: RetryConfig, ) -> Self
pub fn add_user_message(&mut self, text: String)
pub fn tool_names(&self) -> Vec<String>
pub fn tool_schema(&self, name: &str) -> Option<(String, String, Value)>
pub async fn call_tool_direct( &self, name: &str, args: Value, ) -> Option<ToolResult>
pub fn set_observer(&mut self, obs: Arc<dyn AgentObserver>)
pub fn builder(llm: LlmClient, system_prompt: String) -> AgentBuilder
pub async fn run(&mut self) -> Result<String>
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl !UnwindSafe 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