MultiAgentBase

Trait MultiAgentBase 

Source
pub trait MultiAgentBase: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn invoke_async<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        task: MultiAgentInput,
        invocation_state: Option<&'life1 InvocationState>,
    ) -> Pin<Box<dyn Future<Output = Result<MultiAgentResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream_async<'a>(
        &'a mut self,
        task: MultiAgentInput,
        invocation_state: Option<&'a InvocationState>,
    ) -> MultiAgentEventStream<'a>;
    fn serialize_state(&self) -> Value;
    fn deserialize_state(&mut self, payload: &Value) -> Result<()>;
}
Expand description

Base trait for multi-agent orchestration patterns.

Required Methods§

Source

fn id(&self) -> &str

Returns the unique ID of this multi-agent system.

Source

fn invoke_async<'life0, 'life1, 'async_trait>( &'life0 mut self, task: MultiAgentInput, invocation_state: Option<&'life1 InvocationState>, ) -> Pin<Box<dyn Future<Output = Result<MultiAgentResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invokes the multi-agent system asynchronously.

Source

fn stream_async<'a>( &'a mut self, task: MultiAgentInput, invocation_state: Option<&'a InvocationState>, ) -> MultiAgentEventStream<'a>

Streams events during multi-agent execution.

Source

fn serialize_state(&self) -> Value

Serializes the current state for persistence.

Source

fn deserialize_state(&mut self, payload: &Value) -> Result<()>

Deserializes state from persistence.

Implementors§