pub struct WorkflowClient { /* private fields */ }Expand description
A client that wraps SimpleAgentsClient and exposes workflow operations.
The workflow methods (run, stream, resume) live here rather than on
SimpleAgentsClient because simple-agents-core cannot depend on
simple-agents-workflow without creating a circular crate dependency.
Implementations§
Source§impl WorkflowClient
impl WorkflowClient
Sourcepub fn from_client(client: SimpleAgentsClient) -> Self
pub fn from_client(client: SimpleAgentsClient) -> Self
Create a WorkflowClient from an already-built SimpleAgentsClient.
Sourcepub fn client(&self) -> &SimpleAgentsClient
pub fn client(&self) -> &SimpleAgentsClient
Expose the underlying SimpleAgentsClient for direct LLM calls.
Sourcepub async fn run(
&self,
workflow_path: &str,
messages: Vec<Message>,
options: RunOptions,
) -> Result<WorkflowRunOutput, WorkflowError>
pub async fn run( &self, workflow_path: &str, messages: Vec<Message>, options: RunOptions, ) -> Result<WorkflowRunOutput, WorkflowError>
Run a YAML workflow file and return the full output.
Tools are configured in the workflow YAML itself; runtime tool executors
(Python custom_worker / Node handler callbacks) are currently wired
through the binding layer.
Sourcepub async fn stream(
&self,
workflow_path: &str,
messages: Vec<Message>,
sink: &dyn WorkflowEventSink,
options: RunOptions,
) -> Result<WorkflowRunOutput, WorkflowError>
pub async fn stream( &self, workflow_path: &str, messages: Vec<Message>, sink: &dyn WorkflowEventSink, options: RunOptions, ) -> Result<WorkflowRunOutput, WorkflowError>
Stream a YAML workflow file, emitting events to sink.
Pass &DefaultEventPrinter to get tokens printed to stdout by default.
Sourcepub async fn resume(
&self,
checkpoint: WorkflowCheckpoint,
options: RunOptions,
) -> Result<WorkflowRunOutput, WorkflowError>
pub async fn resume( &self, checkpoint: WorkflowCheckpoint, options: RunOptions, ) -> Result<WorkflowRunOutput, WorkflowError>
Resume a workflow from a saved checkpoint.
Sourcepub async fn complete(
&self,
request: &CompletionRequest,
options: CompletionOptions,
) -> Result<CompletionOutcome, SimpleAgentsError>
pub async fn complete( &self, request: &CompletionRequest, options: CompletionOptions, ) -> Result<CompletionOutcome, SimpleAgentsError>
Direct LLM completion (delegates to the inner client).
Auto Trait Implementations§
impl Freeze for WorkflowClient
impl !RefUnwindSafe for WorkflowClient
impl Send for WorkflowClient
impl Sync for WorkflowClient
impl Unpin for WorkflowClient
impl UnsafeUnpin for WorkflowClient
impl !UnwindSafe for WorkflowClient
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> 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> 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