Skip to main content

WorkflowContext

Defined in the Workflows module.
Rust AI Agent SDK Workflow context passed between agents

Fields

NameTypeDescription
variablesstd::collections::HashMap<StringVariables available to all agents
resultsVec<StepResult>Results from previous steps

Methods

new

fn new() -> Self
Create a new empty context

set

fn set(&mut self, key: impl Into<String>, value: impl Into<String>) -> ()
Set a variable Parameters:
NameType
keyimpl Into&lt;String&gt;
valueimpl Into&lt;String&gt;

get

fn get(&self, key: &str) -> Option<&String>
Get a variable Parameters:
NameType
key&str

add_result

fn add_result(&mut self, result: StepResult) -> ()
Add a step result Parameters:
NameType
resultStepResult

last_result

fn last_result(&self) -> Option<&StepResult>
Get the last result