Skip to main content

when

Function
This function is defined in the workflow_aliases module.
Alias for route (matches Python SDK naming) Creates a conditional routing step.

Signature

def when(
    condition: F,
    if_true: Arc<crate::agent::Agent>,
    if_false: Option<Arc<crate::agent::Agent>>,
) -> crate::workflows::FlowStep
where
    F: Fn(&str) -> bool + Send + Sync + 'static,

Parameters

condition
F
required
No description available.
if_true
Arc<crate::agent::Agent>
required
No description available.
if_false
Option<Arc<crate::agent::Agent>>
required
No description available.

Returns

Returns
crate::workflows::FlowStep where F: Fn(&str) -> bool + Send + Sync + 'static,
The result of the operation.

Uses

  • route

Source

View on GitHub

praisonai/src/parity/workflow_aliases.rs at line 123