Skip to main content

DictCondition

Defined in the conditions module.
Rust AI Agent SDK Dictionary-based condition for routing. Maps values to target tasks/steps.

Fields

NameTypeDescription
variableStringVariable name to check
routesHashMap<StringMapping of values to target tasks
defaultVec<String>Default targets if no match

Methods

new

fn new(variable: impl Into<String>) -> Self
Create a new dict condition. Parameters:
NameType
variableimpl Into&lt;String&gt;

when

fn when(mut self, value: impl Into<String>, targets: Vec<String>) -> Self
Add a route for a value. Parameters:
NameType
valueimpl Into&lt;String&gt;
targetsVec&lt;String&gt;

default_targets

fn default_targets(mut self, targets: Vec<String>) -> Self
Set default targets. Parameters:
NameType
targetsVec&lt;String&gt;

Source

View on GitHub

praisonai/src/conditions/mod.rs at line 191