Workflow Context • Rust AI Agent SDK
WorkflowContext: Workflow context passed between agents
WorkflowContext
Defined in the workflows module.
Rust AI Agent SDK
Workflow context passed between agents
Fields
| Name | Type | Description |
|---|---|---|
variables | std::collections::HashMap<String | Variables available to all agents |
results | Vec<StepResult> | Results from previous steps |
Methods
new
fn new() -> SelfCreate a new empty context
set
fn set(&mut self, key: impl Into<String>, value: impl Into<String>) -> ()Set a variable
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Into<String> |
get
fn get(&self, key: &str) -> Option<&String>Get a variable
Parameters:
| Name | Type |
|---|---|
key | &str |
add_result
fn add_result(&mut self, result: StepResult) -> ()Add a step result
Parameters:
| Name | Type |
|---|---|
result | StepResult |
last_result
fn last_result(&self) -> Option<&StepResult>Get the last result
Source
View on GitHubpraisonai/src/workflows/mod.rs at line 64