pub struct GraphAgentBuilder { /* private fields */ }Expand description
Builder for GraphAgent
Implementations§
Source§impl GraphAgentBuilder
impl GraphAgentBuilder
Sourcepub fn description(self, desc: &str) -> Self
pub fn description(self, desc: &str) -> Self
Set description
Sourcepub fn state_schema(self, schema: StateSchema) -> Self
pub fn state_schema(self, schema: StateSchema) -> Self
Set state schema
Sourcepub fn node_fn<F, Fut>(self, name: &str, func: F) -> Selfwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput>> + Send + 'static,
pub fn node_fn<F, Fut>(self, name: &str, func: F) -> Selfwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput>> + Send + 'static,
Add a function as a node
Sourcepub fn conditional_edge<F, I>(self, source: &str, router: F, targets: I) -> Self
pub fn conditional_edge<F, I>(self, source: &str, router: F, targets: I) -> Self
Add a conditional edge
Sourcepub fn checkpointer<C: Checkpointer + 'static>(self, checkpointer: C) -> Self
pub fn checkpointer<C: Checkpointer + 'static>(self, checkpointer: C) -> Self
Set checkpointer
Sourcepub fn checkpointer_arc(self, checkpointer: Arc<dyn Checkpointer>) -> Self
pub fn checkpointer_arc(self, checkpointer: Arc<dyn Checkpointer>) -> Self
Set checkpointer with Arc
Sourcepub fn interrupt_before(self, nodes: &[&str]) -> Self
pub fn interrupt_before(self, nodes: &[&str]) -> Self
Set nodes to interrupt before
Sourcepub fn interrupt_after(self, nodes: &[&str]) -> Self
pub fn interrupt_after(self, nodes: &[&str]) -> Self
Set nodes to interrupt after
Sourcepub fn recursion_limit(self, limit: usize) -> Self
pub fn recursion_limit(self, limit: usize) -> Self
Set recursion limit
Sourcepub fn input_mapper<F>(self, mapper: F) -> Self
pub fn input_mapper<F>(self, mapper: F) -> Self
Set custom input mapper
Sourcepub fn output_mapper<F>(self, mapper: F) -> Self
pub fn output_mapper<F>(self, mapper: F) -> Self
Set custom output mapper
Sourcepub fn before_agent_callback<F, Fut>(self, callback: F) -> Self
pub fn before_agent_callback<F, Fut>(self, callback: F) -> Self
Set before agent callback
Sourcepub fn after_agent_callback<F, Fut>(self, callback: F) -> Self
pub fn after_agent_callback<F, Fut>(self, callback: F) -> Self
Set after agent callback
Note: The callback receives a cloned Event to avoid lifetime issues.
Sourcepub fn build(self) -> Result<GraphAgent>
pub fn build(self) -> Result<GraphAgent>
Build the GraphAgent