pub struct PlanExecuteAgent { /* private fields */ }Expand description
Plan-Execute Agent: plans first, executes step by step, and replans on failure.
Supports any LLM provider that implements BaseChatModel.
Implementations§
Source§impl PlanExecuteAgent
impl PlanExecuteAgent
Sourcepub fn from_arc(
llm: Arc<dyn BaseChatModel<Error = ProviderError> + Send + Sync>,
tools: Vec<Arc<dyn BaseTool>>,
) -> Self
pub fn from_arc( llm: Arc<dyn BaseChatModel<Error = ProviderError> + Send + Sync>, tools: Vec<Arc<dyn BaseTool>>, ) -> Self
Creates an agent from an already-wrapped Arc<dyn BaseChatModel>
Sourcepub fn with_max_replans(self, n: usize) -> Self
pub fn with_max_replans(self, n: usize) -> Self
Sets the maximum number of replans.
Sourcepub fn with_agent_factory(
self,
factory: Arc<dyn Fn() -> Arc<dyn BaseAgent> + Send + Sync>,
) -> Self
pub fn with_agent_factory( self, factory: Arc<dyn Fn() -> Arc<dyn BaseAgent> + Send + Sync>, ) -> Self
Custom factory for the per-step execution agent (P1-2).
The BaseAgent returned by the factory is used for each execute_step
of the PlanExecute. Defaults to FunctionCallingAgent. Useful for
injecting ReAct / Streaming / custom agents as the execution agent.
Trait Implementations§
Source§impl Orchestrator for PlanExecuteAgent
impl Orchestrator for PlanExecuteAgent
Source§fn run_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Self::Input,
ctx: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Self::Input,
ctx: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execution entry point carrying the run context.
Auto Trait Implementations§
impl !RefUnwindSafe for PlanExecuteAgent
impl !UnwindSafe for PlanExecuteAgent
impl Freeze for PlanExecuteAgent
impl Send for PlanExecuteAgent
impl Sync for PlanExecuteAgent
impl Unpin for PlanExecuteAgent
impl UnsafeUnpin for PlanExecuteAgent
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