Dict Condition • Rust AI Agent SDK
DictCondition: Dictionary-based condition for routing. Maps values to target tasks/steps.
DictCondition
Defined in the conditions module.
Rust AI Agent SDK
Dictionary-based condition for routing. Maps values to target tasks/steps.
Fields
| Name | Type | Description |
|---|---|---|
variable | String | Variable name to check |
routes | HashMap<String | Mapping of values to target tasks |
default | Vec<String> | Default targets if no match |
Methods
new
fn new(variable: impl Into<String>) -> SelfCreate a new dict condition.
Parameters:
| Name | Type |
|---|---|
variable | impl Into<String> |
when
fn when(mut self, value: impl Into<String>, targets: Vec<String>) -> SelfAdd a route for a value.
Parameters:
| Name | Type |
|---|---|
value | impl Into<String> |
targets | Vec<String> |
default_targets
fn default_targets(mut self, targets: Vec<String>) -> SelfSet default targets.
Parameters:
| Name | Type |
|---|---|
targets | Vec<String> |
Source
View on GitHubpraisonai/src/conditions/mod.rs at line 191