pub struct GraphAgentBuilder { /* private fields */ }Available on crate feature
graph only.Expand description
Builder for GraphAgent
Implementations§
Source§impl GraphAgentBuilder
impl GraphAgentBuilder
Sourcepub fn new(name: &str) -> GraphAgentBuilder
pub fn new(name: &str) -> GraphAgentBuilder
Create a new builder
Sourcepub fn description(self, desc: &str) -> GraphAgentBuilder
pub fn description(self, desc: &str) -> GraphAgentBuilder
Set description
Sourcepub fn state_schema(self, schema: StateSchema) -> GraphAgentBuilder
pub fn state_schema(self, schema: StateSchema) -> GraphAgentBuilder
Set state schema
Sourcepub fn channels(self, channels: &[&str]) -> GraphAgentBuilder
pub fn channels(self, channels: &[&str]) -> GraphAgentBuilder
Add channels to state schema
Sourcepub fn node<N>(self, node: N) -> GraphAgentBuilderwhere
N: Node + 'static,
pub fn node<N>(self, node: N) -> GraphAgentBuilderwhere
N: Node + 'static,
Add a node
Sourcepub fn node_fn<F, Fut>(self, name: &str, func: F) -> GraphAgentBuilderwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput, GraphError>> + Send + 'static,
pub fn node_fn<F, Fut>(self, name: &str, func: F) -> GraphAgentBuilderwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput, GraphError>> + Send + 'static,
Add a function as a node
Sourcepub fn edge(self, source: &str, target: &str) -> GraphAgentBuilder
pub fn edge(self, source: &str, target: &str) -> GraphAgentBuilder
Add a direct edge
Sourcepub fn conditional_edge<F, I>(
self,
source: &str,
router: F,
targets: I,
) -> GraphAgentBuilder
pub fn conditional_edge<F, I>( self, source: &str, router: F, targets: I, ) -> GraphAgentBuilder
Add a conditional edge
Sourcepub fn checkpointer<C>(self, checkpointer: C) -> GraphAgentBuilderwhere
C: Checkpointer + 'static,
pub fn checkpointer<C>(self, checkpointer: C) -> GraphAgentBuilderwhere
C: Checkpointer + 'static,
Set checkpointer
Sourcepub fn checkpointer_arc(
self,
checkpointer: Arc<dyn Checkpointer>,
) -> GraphAgentBuilder
pub fn checkpointer_arc( self, checkpointer: Arc<dyn Checkpointer>, ) -> GraphAgentBuilder
Set checkpointer with Arc
Sourcepub fn interrupt_before(self, nodes: &[&str]) -> GraphAgentBuilder
pub fn interrupt_before(self, nodes: &[&str]) -> GraphAgentBuilder
Set nodes to interrupt before
Sourcepub fn interrupt_after(self, nodes: &[&str]) -> GraphAgentBuilder
pub fn interrupt_after(self, nodes: &[&str]) -> GraphAgentBuilder
Set nodes to interrupt after
Sourcepub fn recursion_limit(self, limit: usize) -> GraphAgentBuilder
pub fn recursion_limit(self, limit: usize) -> GraphAgentBuilder
Set recursion limit
Sourcepub fn input_mapper<F>(self, mapper: F) -> GraphAgentBuilder
pub fn input_mapper<F>(self, mapper: F) -> GraphAgentBuilder
Set custom input mapper
Sourcepub fn output_mapper<F>(self, mapper: F) -> GraphAgentBuilder
pub fn output_mapper<F>(self, mapper: F) -> GraphAgentBuilder
Set custom output mapper
Sourcepub fn before_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
pub fn before_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
Set before agent callback
Sourcepub fn after_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
pub fn after_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
Set after agent callback
Note: The callback receives a cloned Event to avoid lifetime issues.
Sourcepub fn build(self) -> Result<GraphAgent, GraphError>
pub fn build(self) -> Result<GraphAgent, GraphError>
Build the GraphAgent
Auto Trait Implementations§
impl Freeze for GraphAgentBuilder
impl !RefUnwindSafe for GraphAgentBuilder
impl Send for GraphAgentBuilder
impl Sync for GraphAgentBuilder
impl Unpin for GraphAgentBuilder
impl !UnwindSafe for GraphAgentBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request