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§
Sourcefn 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 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.
Sourcefn stream_async<'a>(
&'a mut self,
task: MultiAgentInput,
invocation_state: Option<&'a InvocationState>,
) -> MultiAgentEventStream<'a>
fn stream_async<'a>( &'a mut self, task: MultiAgentInput, invocation_state: Option<&'a InvocationState>, ) -> MultiAgentEventStream<'a>
Streams events during multi-agent execution.
Sourcefn serialize_state(&self) -> Value
fn serialize_state(&self) -> Value
Serializes the current state for persistence.
Sourcefn deserialize_state(&mut self, payload: &Value) -> Result<()>
fn deserialize_state(&mut self, payload: &Value) -> Result<()>
Deserializes state from persistence.