pub struct AgentTask<C: LLMClient> {
pub id: String,
pub conversation_id: Uuid,
pub task_description: String,
pub context_agent: ContextAgent<C>,
pub action_agent: ActionAgent<C>,
pub verifier_agent: VerifierAgent<C>,
pub state: TaskState,
pub tool_registry: ToolRegistry,
}Expand description
/// Represents a complete agent task composed of three specialized agents:
- ContextAgent: Gathers and analyzes context
- ActionAgent: Takes actions based on context
- VerifierAgent: Verifies actions were successful
Fields§
§id: String§conversation_id: Uuid§task_description: String§context_agent: ContextAgent<C>§action_agent: ActionAgent<C>§verifier_agent: VerifierAgent<C>§state: TaskState§tool_registry: ToolRegistryImplementations§
Source§impl<C: LLMClient + Send + Sync> AgentTask<C>
impl<C: LLMClient + Send + Sync> AgentTask<C>
pub fn new(
id: impl Into<String>,
task_description: impl Into<String>,
client: C,
) -> Selfwhere
C: Clone,
Sourcepub fn add_tool<T: ToolImplementation + 'static>(&self, tool: T)
pub fn add_tool<T: ToolImplementation + 'static>(&self, tool: T)
Add tool to AgentTask ToolRegistry for ActionAgent
Sourcepub fn add_tool_arc(&self, tool: Arc<dyn ToolImplementation>)
pub fn add_tool_arc(&self, tool: Arc<dyn ToolImplementation>)
Add a pre-wrapped tool (Arc<dyn ToolImplementation>) to the registry
Sourcepub async fn remove_tool(
&mut self,
name: &str,
) -> Result<Option<Arc<dyn ToolImplementation>>>
pub async fn remove_tool( &mut self, name: &str, ) -> Result<Option<Arc<dyn ToolImplementation>>>
Remove Tool from AgentTask ToolRegistry
Sourcepub fn get_all_tools(&self) -> Vec<Tool>
pub fn get_all_tools(&self) -> Vec<Tool>
Get all Tools from AgentTask ToolRegistry
Sourcepub async fn gather_context(&mut self) -> Result<AgentResponse>
pub async fn gather_context(&mut self) -> Result<AgentResponse>
Execute the context gathering phase
Sourcepub async fn take_action(&mut self) -> Result<AgentResponse>
pub async fn take_action(&mut self) -> Result<AgentResponse>
Execute the action phase using context from previous phase
Sourcepub async fn verify(&mut self) -> Result<AgentResponse>
pub async fn verify(&mut self) -> Result<AgentResponse>
Execute the verification phase
Sourcepub async fn execute_full(&mut self) -> Result<TaskResponse>
pub async fn execute_full(&mut self) -> Result<TaskResponse>
Execute the full task pipeline: context -> action -> verify
Auto Trait Implementations§
impl<C> Freeze for AgentTask<C>where
C: Freeze,
impl<C> !RefUnwindSafe for AgentTask<C>
impl<C> Send for AgentTask<C>
impl<C> Sync for AgentTask<C>
impl<C> Unpin for AgentTask<C>where
C: Unpin,
impl<C> !UnwindSafe for AgentTask<C>
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