pub struct Graph { /* private fields */ }Expand description
A graph of agents for orchestrated execution.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn builder() -> GraphBuilder
pub fn builder() -> GraphBuilder
Creates a new graph builder.
Sourcepub fn state(&self) -> &GraphState
pub fn state(&self) -> &GraphState
Returns the current graph state.
Sourcepub fn entry_points(&self) -> &HashSet<String>
pub fn entry_points(&self) -> &HashSet<String>
Returns the entry point node IDs.
Sourcepub fn interrupt_state(&self) -> &InterruptState
pub fn interrupt_state(&self) -> &InterruptState
Returns a reference to the interrupt state.
Sourcepub fn interrupt_state_mut(&mut self) -> &mut InterruptState
pub fn interrupt_state_mut(&mut self) -> &mut InterruptState
Returns a mutable reference to the interrupt state.
Sourcepub fn call(&mut self, task: impl Into<MultiAgentInput>) -> Result<GraphResult>
pub fn call(&mut self, task: impl Into<MultiAgentInput>) -> Result<GraphResult>
Invokes the graph synchronously.
Sourcepub async fn invoke_async(
&mut self,
task: MultiAgentInput,
invocation_state: Option<&InvocationState>,
) -> Result<GraphResult>
pub async fn invoke_async( &mut self, task: MultiAgentInput, invocation_state: Option<&InvocationState>, ) -> Result<GraphResult>
Invokes the graph asynchronously and returns the result.
Sourcepub fn stream_async<'a>(
&'a mut self,
task: MultiAgentInput,
_invocation_state: Option<&'a InvocationState>,
) -> MultiAgentEventStream<'a>
pub fn stream_async<'a>( &'a mut self, task: MultiAgentInput, _invocation_state: Option<&'a InvocationState>, ) -> MultiAgentEventStream<'a>
Streams events during graph execution.
Trait Implementations§
Source§impl MultiAgentBase for Graph
impl MultiAgentBase for Graph
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,
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>
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
fn serialize_state(&self) -> Value
Serializes the current state for persistence.
Auto Trait Implementations§
impl Freeze for Graph
impl !RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl !UnwindSafe for Graph
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.