mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Minor cleanups
This commit is contained in:
@@ -50,8 +50,8 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
|
||||
await host.StartAsync();
|
||||
|
||||
// Get the DurableExecutionEnvironment from DI - no need to manually resolve DurableTaskClient
|
||||
DurableExecutionEnvironment durableExecution = host.Services.GetRequiredService<DurableExecutionEnvironment>();
|
||||
// Get the IWorkflowClient from DI - no need to manually resolve DurableTaskClient
|
||||
IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
|
||||
|
||||
Console.WriteLine("Durable Workflow Sample");
|
||||
Console.WriteLine("Workflow: OrderLookup (2s) -> OrderCancel (5s) -> SendEmail (1s)");
|
||||
@@ -75,7 +75,7 @@ while (true)
|
||||
|
||||
try
|
||||
{
|
||||
await StartNewWorkflowAsync(input, cancelOrder, durableExecution);
|
||||
await StartNewWorkflowAsync(input, cancelOrder, workflowClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -87,13 +87,13 @@ while (true)
|
||||
|
||||
await host.StopAsync();
|
||||
|
||||
// Start a new workflow using DurableExecutionEnvironment (no DurableTaskClient needed)
|
||||
async Task StartNewWorkflowAsync(string orderId, Workflow workflow, DurableExecutionEnvironment execution)
|
||||
// Start a new workflow using IWorkflowClient (no DurableTaskClient needed)
|
||||
async Task StartNewWorkflowAsync(string orderId, Workflow workflow, IWorkflowClient client)
|
||||
{
|
||||
Console.WriteLine($"Starting workflow for order '{orderId}'...");
|
||||
|
||||
// RunAsync returns IRun, cast to DurableRun for durable-specific features like WaitForCompletionAsync
|
||||
await using DurableRun run = (DurableRun)await execution.RunAsync(workflow, orderId);
|
||||
await using DurableRun run = (DurableRun)await client.RunAsync(workflow, orderId);
|
||||
Console.WriteLine($"Instance ID: {run.InstanceId}");
|
||||
|
||||
try
|
||||
|
||||
@@ -77,8 +77,8 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
|
||||
await host.StartAsync();
|
||||
|
||||
// Get the DurableExecutionEnvironment from DI - no need to manually resolve DurableTaskClient
|
||||
DurableExecutionEnvironment durableExecution = host.Services.GetRequiredService<DurableExecutionEnvironment>();
|
||||
// Get the IWorkflowClient from DI - no need to manually resolve DurableTaskClient
|
||||
IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
|
||||
|
||||
// Console UI
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
@@ -111,7 +111,7 @@ while (true)
|
||||
try
|
||||
{
|
||||
// Cast to DurableRun for durable-specific features like InstanceId and WaitForCompletionAsync
|
||||
await using DurableRun run = (DurableRun)await durableExecution.RunAsync(workflow, input);
|
||||
await using DurableRun run = (DurableRun)await workflowClient.RunAsync(workflow, input);
|
||||
Console.ForegroundColor = ConsoleColor.Gray;
|
||||
Console.WriteLine($"Instance: {run.InstanceId}");
|
||||
Console.ResetColor();
|
||||
|
||||
@@ -43,8 +43,8 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
|
||||
await host.StartAsync();
|
||||
|
||||
// Get the DurableExecutionEnvironment from DI - no need to manually resolve DurableTaskClient
|
||||
DurableExecutionEnvironment durableExecution = host.Services.GetRequiredService<DurableExecutionEnvironment>();
|
||||
// Get the IWorkflowClient from DI - no need to manually resolve DurableTaskClient
|
||||
IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
|
||||
|
||||
// Start the workflow with an expense ID as input
|
||||
string expenseId = "EXP-2025-001";
|
||||
@@ -52,7 +52,7 @@ Console.WriteLine($"Starting expense reimbursement workflow for expense: {expens
|
||||
|
||||
// Start the workflow and get a streaming handle
|
||||
// Cast to DurableStreamingRun for durable-specific features like InstanceId and SendResponseAsync
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await durableExecution.StreamAsync(expenseApproval, expenseId);
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await workflowClient.StreamAsync(expenseApproval, expenseId);
|
||||
|
||||
Console.WriteLine($"Workflow started with instance ID: {run.InstanceId}");
|
||||
Console.WriteLine("Watching for workflow events...\n");
|
||||
|
||||
@@ -54,8 +54,8 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
|
||||
await host.StartAsync();
|
||||
|
||||
// Get the DurableExecutionEnvironment from DI - no need to manually resolve DurableTaskClient
|
||||
DurableExecutionEnvironment durableExecution = host.Services.GetRequiredService<DurableExecutionEnvironment>();
|
||||
// Get the IWorkflowClient from DI - no need to manually resolve DurableTaskClient
|
||||
IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
|
||||
|
||||
Console.WriteLine("Workflow Events Demo - Enter order ID (or 'exit'):");
|
||||
|
||||
@@ -70,7 +70,7 @@ while (true)
|
||||
|
||||
try
|
||||
{
|
||||
await RunWorkflowWithStreamingAsync(input, cancelOrder, durableExecution);
|
||||
await RunWorkflowWithStreamingAsync(input, cancelOrder, workflowClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -83,11 +83,11 @@ while (true)
|
||||
await host.StopAsync();
|
||||
|
||||
// Runs a workflow and streams events as they occur
|
||||
async Task RunWorkflowWithStreamingAsync(string orderId, Workflow workflow, DurableExecutionEnvironment execution)
|
||||
async Task RunWorkflowWithStreamingAsync(string orderId, Workflow workflow, IWorkflowClient client)
|
||||
{
|
||||
// StreamAsync starts the workflow and returns a handle for observing events
|
||||
// Cast to DurableStreamingRun for durable-specific features like InstanceId
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await execution.StreamAsync(workflow, orderId);
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await client.StreamAsync(workflow, orderId);
|
||||
Console.WriteLine($"Started: {run.InstanceId}");
|
||||
|
||||
// WatchStreamAsync yields events as they're emitted by executors
|
||||
|
||||
@@ -61,8 +61,8 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
|
||||
await host.StartAsync();
|
||||
|
||||
// Get the DurableExecutionEnvironment from DI - no need to manually resolve DurableTaskClient
|
||||
DurableExecutionEnvironment durableExecution = host.Services.GetRequiredService<DurableExecutionEnvironment>();
|
||||
// Get the IWorkflowClient from DI - no need to manually resolve DurableTaskClient
|
||||
IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
|
||||
|
||||
Console.WriteLine("Workflow Events Demo - Enter input for slogan generation (or 'exit'):");
|
||||
|
||||
@@ -77,7 +77,7 @@ while (true)
|
||||
|
||||
try
|
||||
{
|
||||
await RunWorkflowWithStreamingAsync(input, workflow, durableExecution);
|
||||
await RunWorkflowWithStreamingAsync(input, workflow, workflowClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -90,11 +90,11 @@ while (true)
|
||||
await host.StopAsync();
|
||||
|
||||
// Runs a workflow and streams events as they occur
|
||||
async Task RunWorkflowWithStreamingAsync(string orderId, Workflow workflow, DurableExecutionEnvironment execution)
|
||||
async Task RunWorkflowWithStreamingAsync(string orderId, Workflow workflow, IWorkflowClient client)
|
||||
{
|
||||
// StreamAsync starts the workflow and returns a handle for observing events
|
||||
// Cast to DurableStreamingRun for durable-specific features like InstanceId
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await execution.StreamAsync(workflow, orderId);
|
||||
await using DurableStreamingRun run = (DurableStreamingRun)await client.StreamAsync(workflow, orderId);
|
||||
Console.WriteLine($"Started: {run.InstanceId}");
|
||||
|
||||
// WatchStreamAsync yields events as they're emitted by executors
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using Microsoft.Agents.AI.Workflows;
|
||||
using Microsoft.DurableTask.Client;
|
||||
|
||||
namespace Microsoft.Agents.AI.DurableTask;
|
||||
|
||||
/// <summary>
|
||||
/// Provides a DI-friendly execution environment for running workflows as durable orchestrations.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class wraps the <see cref="DurableTaskClient"/> and provides methods to run workflows
|
||||
/// without requiring the client to be passed explicitly. Register this class in DI using
|
||||
/// <see cref="DurableWorkflowServiceCollectionExtensions.ConfigureDurableWorkflows"/>.
|
||||
/// </remarks>
|
||||
public sealed class DurableExecutionEnvironment
|
||||
{
|
||||
private readonly DurableTaskClient _client;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DurableExecutionEnvironment"/> class.
|
||||
/// </summary>
|
||||
/// <param name="client">The durable task client for orchestration operations.</param>
|
||||
public DurableExecutionEnvironment(DurableTaskClient client)
|
||||
{
|
||||
this._client = client ?? throw new ArgumentNullException(nameof(client));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a workflow as a durable orchestration and returns a handle to monitor its execution.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input to the workflow.</typeparam>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The input to pass to the workflow's starting executor.</param>
|
||||
/// <param name="instanceId">Optional instance ID for the orchestration. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
/// <exception cref="ArgumentNullException">Thrown when workflow is null.</exception>
|
||||
/// <exception cref="ArgumentException">Thrown when the workflow does not have a valid name.</exception>
|
||||
public ValueTask<IRun> RunAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? instanceId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull
|
||||
=> DurableWorkflow.RunAsync(workflow, input, this._client, instanceId, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Runs a workflow as a durable orchestration with string input.
|
||||
/// </summary>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The string input to pass to the workflow.</param>
|
||||
/// <param name="instanceId">Optional instance ID for the orchestration.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
public ValueTask<IRun> RunAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? instanceId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
=> DurableWorkflow.RunAsync(workflow, input, this._client, instanceId, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Starts a workflow as a durable orchestration and returns a streaming handle to watch events.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input to the workflow.</typeparam>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The input to pass to the workflow's starting executor.</param>
|
||||
/// <param name="instanceId">Optional instance ID for the orchestration. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
/// <exception cref="ArgumentNullException">Thrown when workflow is null.</exception>
|
||||
/// <exception cref="ArgumentException">Thrown when the workflow does not have a valid name.</exception>
|
||||
public ValueTask<IStreamingRun> StreamAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? instanceId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull
|
||||
=> DurableWorkflow.StreamAsync(workflow, input, this._client, instanceId, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Starts a workflow as a durable orchestration with string input and returns a streaming handle.
|
||||
/// </summary>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The string input to pass to the workflow.</param>
|
||||
/// <param name="instanceId">Optional instance ID for the orchestration.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
public ValueTask<IStreamingRun> StreamAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? instanceId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
=> DurableWorkflow.StreamAsync(workflow, input, this._client, instanceId, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Attaches to an existing workflow orchestration instance.
|
||||
/// </summary>
|
||||
/// <param name="instanceId">The instance ID of the orchestration to attach to.</param>
|
||||
/// <param name="workflowName">The name of the workflow being executed.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
public IRun Attach(string instanceId, string workflowName)
|
||||
=> DurableWorkflow.Attach(instanceId, workflowName, this._client);
|
||||
|
||||
/// <summary>
|
||||
/// Attaches to an existing workflow orchestration instance for streaming.
|
||||
/// </summary>
|
||||
/// <param name="instanceId">The instance ID of the orchestration to attach to.</param>
|
||||
/// <param name="workflow">The workflow being executed.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
public IStreamingRun AttachStream(string instanceId, Workflow workflow)
|
||||
=> DurableWorkflow.AttachStream(instanceId, workflow, this._client);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using Microsoft.Agents.AI.Workflows;
|
||||
using Microsoft.DurableTask.Client;
|
||||
|
||||
namespace Microsoft.Agents.AI.DurableTask;
|
||||
|
||||
/// <summary>
|
||||
/// Provides a durable task-based implementation of <see cref="IWorkflowClient"/> for running
|
||||
/// workflows as durable orchestrations.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class wraps the <see cref="DurableTaskClient"/> and provides methods to run workflows
|
||||
/// without requiring the client to be passed explicitly. Register this class in DI using
|
||||
/// <see cref="DurableWorkflowServiceCollectionExtensions.ConfigureDurableWorkflows"/>.
|
||||
/// </remarks>
|
||||
public sealed class DurableWorkflowClient : IWorkflowClient
|
||||
{
|
||||
private readonly DurableTaskClient _client;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DurableWorkflowClient"/> class.
|
||||
/// </summary>
|
||||
/// <param name="client">The durable task client for orchestration operations.</param>
|
||||
public DurableWorkflowClient(DurableTaskClient client)
|
||||
{
|
||||
this._client = client ?? throw new ArgumentNullException(nameof(client));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ValueTask<IRun> RunAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull
|
||||
=> DurableWorkflow.RunAsync(workflow, input, this._client, runId, cancellationToken);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ValueTask<IRun> RunAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
=> DurableWorkflow.RunAsync(workflow, input, this._client, runId, cancellationToken);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ValueTask<IStreamingRun> StreamAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull
|
||||
=> DurableWorkflow.StreamAsync(workflow, input, this._client, runId, cancellationToken);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ValueTask<IStreamingRun> StreamAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
=> DurableWorkflow.StreamAsync(workflow, input, this._client, runId, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Attaches to an existing workflow orchestration instance.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is a durable-specific method not available on <see cref="IWorkflowClient"/>.
|
||||
/// </remarks>
|
||||
/// <param name="instanceId">The instance ID of the orchestration to attach to.</param>
|
||||
/// <param name="workflowName">The name of the workflow being executed.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
public IRun Attach(string instanceId, string workflowName)
|
||||
=> DurableWorkflow.Attach(instanceId, workflowName, this._client);
|
||||
|
||||
/// <summary>
|
||||
/// Attaches to an existing workflow orchestration instance for streaming.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is a durable-specific method not available on <see cref="IWorkflowClient"/>.
|
||||
/// </remarks>
|
||||
/// <param name="instanceId">The instance ID of the orchestration to attach to.</param>
|
||||
/// <param name="workflow">The workflow being executed.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
public IStreamingRun AttachStream(string instanceId, Workflow workflow)
|
||||
=> DurableWorkflow.AttachStream(instanceId, workflow, this._client);
|
||||
}
|
||||
+4
-2
@@ -113,8 +113,10 @@ public static class DurableWorkflowServiceCollectionExtensions
|
||||
services.AddDurableTaskClient(clientBuilder);
|
||||
}
|
||||
|
||||
// Register the DurableExecutionEnvironment for DI-friendly workflow execution
|
||||
services.TryAddSingleton<DurableExecutionEnvironment>();
|
||||
// Register the DurableWorkflowClient for DI-friendly workflow execution
|
||||
// Register both the concrete type and the interface
|
||||
services.TryAddSingleton<DurableWorkflowClient>();
|
||||
services.TryAddSingleton<IWorkflowClient>(sp => sp.GetRequiredService<DurableWorkflowClient>());
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using Microsoft.Agents.AI.Workflows;
|
||||
|
||||
namespace Microsoft.Agents.AI.DurableTask;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a client for running and managing workflow executions.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This interface provides a unified API for running workflows across different execution
|
||||
/// environments. Implementations handle the underlying infrastructure details, allowing
|
||||
/// callers to work with workflows without knowledge of the specific execution backend.
|
||||
/// </remarks>
|
||||
public interface IWorkflowClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a workflow and returns a handle to monitor its execution.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input to the workflow.</typeparam>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The input to pass to the workflow's starting executor.</param>
|
||||
/// <param name="runId">Optional identifier for the run. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
ValueTask<IRun> RunAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull;
|
||||
|
||||
/// <summary>
|
||||
/// Runs a workflow with string input and returns a handle to monitor its execution.
|
||||
/// </summary>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The string input to pass to the workflow.</param>
|
||||
/// <param name="runId">Optional identifier for the run. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IRun"/> that can be used to monitor the workflow execution.</returns>
|
||||
ValueTask<IRun> RunAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Starts a workflow and returns a streaming handle to watch events.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input to the workflow.</typeparam>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The input to pass to the workflow's starting executor.</param>
|
||||
/// <param name="runId">Optional identifier for the run. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
ValueTask<IStreamingRun> StreamAsync<TInput>(
|
||||
Workflow workflow,
|
||||
TInput input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TInput : notnull;
|
||||
|
||||
/// <summary>
|
||||
/// Starts a workflow with string input and returns a streaming handle to watch events.
|
||||
/// </summary>
|
||||
/// <param name="workflow">The workflow to execute.</param>
|
||||
/// <param name="input">The string input to pass to the workflow.</param>
|
||||
/// <param name="runId">Optional identifier for the run. If not provided, a new ID will be generated.</param>
|
||||
/// <param name="cancellationToken">A cancellation token to observe.</param>
|
||||
/// <returns>An <see cref="IStreamingRun"/> that can be used to stream workflow events.</returns>
|
||||
ValueTask<IStreamingRun> StreamAsync(
|
||||
Workflow workflow,
|
||||
string input,
|
||||
string? runId = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user