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

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

Methods

new

rust
fn new() -> Self

Create a new empty context

set

rust
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

rust
fn get(&self, key: &str) -> Option<&String>

Get a variable

Parameters:

NameType
key&str

add_result

rust
fn add_result(&mut self, result: StepResult) -> ()

Add a step result

Parameters:

NameType
resultStepResult

last_result

rust
fn last_result(&self) -> Option<&StepResult>

Get the last result

Source

View on GitHub

praisonai/src/workflows/mod.rs at line 64


Related Documentation