pub struct Microagent<P> { /* private fields */ }Expand description
A focused agent for executing a single minimal subtask
This implements the paper’s concept of maximal agentic decomposition (MAD) where each agent handles exactly ONE step (m=1).
Implementations§
Source§impl<P: MicroagentProvider + 'static> Microagent<P>
impl<P: MicroagentProvider + 'static> Microagent<P>
Sourcepub fn new(provider: Arc<P>, subtask: Subtask, config: MicroagentConfig) -> Self
pub fn new(provider: Arc<P>, subtask: Subtask, config: MicroagentConfig) -> Self
Create a new microagent
Sourcepub fn with_defaults(provider: Arc<P>, subtask: Subtask) -> Self
pub fn with_defaults(provider: Arc<P>, subtask: Subtask) -> Self
Create with default configuration
Sourcepub async fn execute_once(
&self,
input: &Value,
) -> MdapResult<SampledResponse<SubtaskOutput>>
pub async fn execute_once( &self, input: &Value, ) -> MdapResult<SampledResponse<SubtaskOutput>>
Execute the subtask once (single sample for voting)
Sourcepub async fn execute_with_voting(
&self,
input: &Value,
voter: &FirstToAheadByKVoter,
) -> MdapResult<VoteResult<SubtaskOutput>>
pub async fn execute_with_voting( &self, input: &Value, voter: &FirstToAheadByKVoter, ) -> MdapResult<VoteResult<SubtaskOutput>>
Execute subtask with voting for error correction
Sourcepub fn config(&self) -> &MicroagentConfig
pub fn config(&self) -> &MicroagentConfig
Get the configuration
Auto Trait Implementations§
impl<P> Freeze for Microagent<P>
impl<P> RefUnwindSafe for Microagent<P>where
P: RefUnwindSafe,
impl<P> Send for Microagent<P>
impl<P> Sync for Microagent<P>
impl<P> Unpin for Microagent<P>
impl<P> UnsafeUnpin for Microagent<P>
impl<P> UnwindSafe for Microagent<P>where
P: RefUnwindSafe,
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