pub struct ExecutionConfig {
pub thread_id: String,
pub resume_from: Option<String>,
pub recursion_limit: usize,
pub metadata: HashMap<String, Value>,
pub parent_context: Option<Arc<dyn InvocationContext>>,
}Expand description
Configuration passed to nodes during execution
Fields§
§thread_id: StringThread identifier for checkpointing
resume_from: Option<String>Resume from a specific checkpoint
recursion_limit: usizeRecursion limit for cycles
metadata: HashMap<String, Value>Additional configuration
parent_context: Option<Arc<dyn InvocationContext>>The invocation this graph run belongs to, when it has one.
An AgentNode runs a real agent, and that agent expects the identity,
services, and cancellation of the run it belongs to. Without a parent the node
has to fabricate them, which makes an agent behave differently inside a graph
than outside it. Set this with
ExecutionConfig::with_parent_context to carry them through; leaving it
unset is standalone mode and is what a graph invoked outside a Runner gets.
Implementations§
Source§impl ExecutionConfig
impl ExecutionConfig
Sourcepub fn with_parent_context(self, parent: Arc<dyn InvocationContext>) -> Self
pub fn with_parent_context(self, parent: Arc<dyn InvocationContext>) -> Self
Carry the invocation this graph run belongs to into its nodes.
An AgentNode then presents the caller’s identity, services, request
context, and cancellation to the agent it runs, instead of a synthetic
standalone context.
Sourcepub fn with_recursion_limit(self, limit: usize) -> Self
pub fn with_recursion_limit(self, limit: usize) -> Self
Set the recursion limit
Sourcepub fn with_resume_from(self, checkpoint_id: &str) -> Self
pub fn with_resume_from(self, checkpoint_id: &str) -> Self
Resume from a specific checkpoint
Sourcepub fn with_metadata(self, key: &str, value: Value) -> Self
pub fn with_metadata(self, key: &str, value: Value) -> Self
Add metadata
Trait Implementations§
Source§impl Clone for ExecutionConfig
impl Clone for ExecutionConfig
Source§fn clone(&self) -> ExecutionConfig
fn clone(&self) -> ExecutionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more