pub struct SwlRuntime { /* private fields */ }Expand description
SWL Workflow Runtime
Implementations§
Source§impl SwlRuntime
impl SwlRuntime
Sourcepub fn with_tool_registry(
client: Arc<ApiClient>,
tool_registry: Arc<ToolRegistry>,
) -> Self
pub fn with_tool_registry( client: Arc<ApiClient>, tool_registry: Arc<ToolRegistry>, ) -> Self
Create a new runtime with a custom tool registry
Sourcepub fn new_dry_run() -> Self
pub fn new_dry_run() -> Self
Create a dry-run runtime (no actual LLM calls)
Sourcepub async fn with_file_persistence(
client: Arc<ApiClient>,
workflow_name: &str,
) -> Result<Self>
pub async fn with_file_persistence( client: Arc<ApiClient>, workflow_name: &str, ) -> Result<Self>
Create a runtime with file-based state persistence
Sourcepub fn with_max_tool_iterations(self, max: usize) -> Self
pub fn with_max_tool_iterations(self, max: usize) -> Self
Set the maximum number of tool iterations per agent execution
Sourcepub async fn execute_workflow(
&self,
doc: &SwlDocument,
workflow_name: &str,
inputs: HashMap<String, VarValue>,
) -> Result<ExecutionResult>
pub async fn execute_workflow( &self, doc: &SwlDocument, workflow_name: &str, inputs: HashMap<String, VarValue>, ) -> Result<ExecutionResult>
Execute a workflow from a document with state persistence
Sourcepub async fn persist_state(&self) -> Result<()>
pub async fn persist_state(&self) -> Result<()>
Persist the current execution context state
Sourcepub async fn load_state(&self) -> Result<()>
pub async fn load_state(&self) -> Result<()>
Load state from persistence
Sourcepub async fn get_context(&self) -> ExecutionContext
pub async fn get_context(&self) -> ExecutionContext
Get execution context
Sourcepub async fn get_execution_trace(&self) -> Vec<ExecutionEvent>
pub async fn get_execution_trace(&self) -> Vec<ExecutionEvent>
Get the execution trace (telemetry events)
Sourcepub async fn get_telemetry_summary(&self) -> WorkflowTelemetry
pub async fn get_telemetry_summary(&self) -> WorkflowTelemetry
Get aggregated telemetry summary
Sourcepub async fn export_telemetry_json(&self) -> Result<String>
pub async fn export_telemetry_json(&self) -> Result<String>
Export telemetry data as JSON string
Sourcepub async fn clear_telemetry(&self)
pub async fn clear_telemetry(&self)
Clear all telemetry data
Sourcepub async fn get_agent_trace(&self, agent_name: &str) -> Vec<ExecutionEvent>
pub async fn get_agent_trace(&self, agent_name: &str) -> Vec<ExecutionEvent>
Get the raw execution trace for a specific agent
Trait Implementations§
Source§impl Clone for SwlRuntime
impl Clone for SwlRuntime
Source§fn clone(&self) -> Self
fn clone(&self) -> Self
Faithful clone: shares the API client, tool registry, and execution
context (so trace events and state written by the clone are visible to
the original), and preserves dry_run / max_tool_iterations /
workflow_name. The safety checker is rebuilt from the same config.
GuardedSwlRuntime relies on this when spawning parallel agent tasks —
cloning used to substitute a fresh dry-run runtime, so guarded parallel
and map-reduce workflows returned [DRY-RUN] placeholder strings while
reporting Completed.
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for SwlRuntime
impl !RefUnwindSafe for SwlRuntime
impl !UnwindSafe for SwlRuntime
impl Send for SwlRuntime
impl Sync for SwlRuntime
impl Unpin for SwlRuntime
impl UnsafeUnpin for SwlRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request