pub struct GraphBuilder { /* private fields */ }Expand description
Builder for constructing graphs.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new() -> Self
Sourcepub fn add_node(self, node_id: impl Into<String>, agent: Agent) -> Self
pub fn add_node(self, node_id: impl Into<String>, agent: Agent) -> Self
Adds a node to the graph.
Sourcepub fn add_edge(self, from: impl Into<String>, to: impl Into<String>) -> Self
pub fn add_edge(self, from: impl Into<String>, to: impl Into<String>) -> Self
Adds an edge between two nodes.
Sourcepub fn add_conditional_edge<F>(
self,
from: impl Into<String>,
to: impl Into<String>,
condition: F,
) -> Self
pub fn add_conditional_edge<F>( self, from: impl Into<String>, to: impl Into<String>, condition: F, ) -> Self
Adds a conditional edge between two nodes.
Sourcepub fn set_entry_points(
self,
entry_points: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn set_entry_points( self, entry_points: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Sets explicit entry points for the graph.
Sourcepub fn set_entry_point(self, node_id: impl Into<String>) -> Self
pub fn set_entry_point(self, node_id: impl Into<String>) -> Self
Sets a single entry point.
Sourcepub fn config(self, config: GraphConfig) -> Self
pub fn config(self, config: GraphConfig) -> Self
Sets the graph configuration.
Sourcepub fn max_node_executions(self, max: usize) -> Self
pub fn max_node_executions(self, max: usize) -> Self
Sets the maximum number of node executions.
Sourcepub fn execution_timeout(self, timeout: Duration) -> Self
pub fn execution_timeout(self, timeout: Duration) -> Self
Sets the execution timeout.
Sourcepub fn node_timeout(self, timeout: Duration) -> Self
pub fn node_timeout(self, timeout: Duration) -> Self
Sets the node timeout.
Sourcepub fn reset_on_revisit(self, enabled: bool) -> Self
pub fn reset_on_revisit(self, enabled: bool) -> Self
Enables reset on revisit.
Sourcepub fn hooks(self, hooks: HookRegistry) -> Self
pub fn hooks(self, hooks: HookRegistry) -> Self
Sets the hook registry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl !RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl !UnwindSafe for GraphBuilder
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.