pub struct LoopAgent { /* private fields */ }Available on crate feature
agents only.Expand description
Loop agent executes sub-agents repeatedly for N iterations or until escalation
Implementations§
Source§impl LoopAgent
impl LoopAgent
Sourcepub fn new(
name: impl Into<String>,
sub_agents: Vec<Arc<dyn Agent>>,
) -> LoopAgent
pub fn new( name: impl Into<String>, sub_agents: Vec<Arc<dyn Agent>>, ) -> LoopAgent
Create a new loop agent with the given name and sub-agents.
Sourcepub fn with_description(self, desc: impl Into<String>) -> LoopAgent
pub fn with_description(self, desc: impl Into<String>) -> LoopAgent
Set the agent description.
Sourcepub fn with_max_iterations(self, max: u32) -> LoopAgent
pub fn with_max_iterations(self, max: u32) -> LoopAgent
Set the maximum number of loop iterations.
Sourcepub fn with_skills(self, index: SkillIndex) -> LoopAgent
Available on crate feature skills only.
pub fn with_skills(self, index: SkillIndex) -> LoopAgent
skills only.Set a preloaded skills index for this agent.
Sourcepub fn with_auto_skills(self) -> Result<LoopAgent, AdkError>
Available on crate feature skills only.
pub fn with_auto_skills(self) -> Result<LoopAgent, AdkError>
skills only.Auto-load skills from .skills/ in the current working directory.
Sourcepub fn with_skills_from_root(
self,
root: impl AsRef<Path>,
) -> Result<LoopAgent, AdkError>
Available on crate feature skills only.
pub fn with_skills_from_root( self, root: impl AsRef<Path>, ) -> Result<LoopAgent, AdkError>
skills only.Auto-load skills from .skills/ under a custom root directory.
Sourcepub fn with_skill_policy(self, policy: SelectionPolicy) -> LoopAgent
Available on crate feature skills only.
pub fn with_skill_policy(self, policy: SelectionPolicy) -> LoopAgent
skills only.Customize skill selection behavior.
Sourcepub fn with_skill_budget(self, max_chars: usize) -> LoopAgent
Available on crate feature skills only.
pub fn with_skill_budget(self, max_chars: usize) -> LoopAgent
skills only.Limit injected skill content length.
Trait Implementations§
Source§impl Agent for LoopAgent
impl Agent for LoopAgent
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a human-readable description of this agent’s purpose.
Source§fn sub_agents(&self) -> &[Arc<dyn Agent>]
fn sub_agents(&self) -> &[Arc<dyn Agent>]
Returns the child agents managed by this agent.
Source§fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn InvocationContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Event, AdkError>> + Send>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
LoopAgent: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn InvocationContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Event, AdkError>> + Send>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
LoopAgent: 'async_trait,
Executes the agent and returns a stream of events.
Auto Trait Implementations§
impl Freeze for LoopAgent
impl !RefUnwindSafe for LoopAgent
impl Send for LoopAgent
impl Sync for LoopAgent
impl Unpin for LoopAgent
impl UnsafeUnpin for LoopAgent
impl !UnwindSafe for LoopAgent
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