pub struct Agent<UI: UserInteraction> { /* private fields */ }Implementations§
Source§impl<UI: UserInteraction + 'static> Agent<UI>
impl<UI: UserInteraction + 'static> Agent<UI>
pub fn new( config: AgentConfig, ui_handler: Arc<UI>, strategy: Box<dyn Strategy<UI> + Send + Sync>, history: Option<Vec<ChatMessage>>, current_user_input: String, provider_registry_override: Option<ProviderRegistry>, mcp_connections_override: Option<HashMap<String, Arc<Mutex<McpConnection>>>>, ) -> Result<Self>
pub fn switch_provider(&mut self, provider_id: &str) -> Result<()>
pub async fn get_completion( &self, messages: Vec<ChatMessage>, tools: Option<&[ToolDefinition]>, ) -> Result<ApiResponse>
pub async fn call_mcp_tool( &self, server_id: &str, tool_name: &str, args: Value, ) -> Result<Value>
pub async fn get_mcp_resource( &self, server_id: &str, uri: &str, ) -> Result<Value>
pub async fn list_mcp_tools(&self) -> Result<Vec<McpTool>>
pub async fn run( &mut self, _working_dir: &Path, ) -> Result<(String, AgentState), AgentError>
Auto Trait Implementations§
impl<UI> !RefUnwindSafe for Agent<UI>
impl<UI> !UnwindSafe for Agent<UI>
impl<UI> Freeze for Agent<UI>
impl<UI> Send for Agent<UI>
impl<UI> Sync for Agent<UI>
impl<UI> Unpin for Agent<UI>
impl<UI> UnsafeUnpin for Agent<UI>
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