pub struct WorkflowBuilder { /* private fields */ }Expand description
Builder for creating workflows
Implementations§
Source§impl WorkflowBuilder
impl WorkflowBuilder
Sourcepub fn add_task_node(self, id: impl Into<String>, task: Task) -> Self
pub fn add_task_node(self, id: impl Into<String>, task: Task) -> Self
Add a task node
Sourcepub fn add_input_node(
self,
id: impl Into<String>,
prompt: impl Into<String>,
input_type: InputType,
) -> Self
pub fn add_input_node( self, id: impl Into<String>, prompt: impl Into<String>, input_type: InputType, ) -> Self
Add a human input node
Sourcepub fn add_decision_node(
self,
id: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn add_decision_node( self, id: impl Into<String>, name: impl Into<String>, ) -> Self
Add a decision node
Sourcepub fn add_custom_node(
self,
id: impl Into<String>,
name: impl Into<String>,
executor: Arc<dyn NodeExecutor>,
) -> Self
pub fn add_custom_node( self, id: impl Into<String>, name: impl Into<String>, executor: Arc<dyn NodeExecutor>, ) -> Self
Add a custom executor node
Sourcepub fn connect(
self,
from: impl Into<String>,
to: impl Into<String>,
condition: Option<Condition>,
) -> Self
pub fn connect( self, from: impl Into<String>, to: impl Into<String>, condition: Option<Condition>, ) -> Self
Connect two nodes
Sourcepub fn connect_with_priority(
self,
from: impl Into<String>,
to: impl Into<String>,
condition: Option<Condition>,
priority: i32,
) -> Self
pub fn connect_with_priority( self, from: impl Into<String>, to: impl Into<String>, condition: Option<Condition>, priority: i32, ) -> Self
Connect with priority
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata
Auto Trait Implementations§
impl Freeze for WorkflowBuilder
impl !RefUnwindSafe for WorkflowBuilder
impl Send for WorkflowBuilder
impl Sync for WorkflowBuilder
impl Unpin for WorkflowBuilder
impl UnsafeUnpin for WorkflowBuilder
impl !UnwindSafe for WorkflowBuilder
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> 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 more