mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
331c750515
* refactor: remove unused internals * feat: Execution Mode for sharing a workflow among concurrent runs * feat: Update WorkflowHostAgent to support concurrent execution * Also update AsAgent APIs to support injecting a CheckpointManager and an IWorkflowExecutionEnvironment * fix: Make Read logic consistent in DeclarativeWorkflowContext
21 lines
711 B
C#
21 lines
711 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.UnitTests;
|
|
|
|
internal static class ExecutionExtensions
|
|
{
|
|
public static IWorkflowExecutionEnvironment ToWorkflowExecutionEnvironment(this ExecutionEnvironment environment)
|
|
{
|
|
return environment switch
|
|
{
|
|
ExecutionEnvironment.InProcess_OffThread => InProcessExecution.OffThread,
|
|
ExecutionEnvironment.InProcess_Lockstep => InProcessExecution.Lockstep,
|
|
ExecutionEnvironment.InProcess_Concurrent => InProcessExecution.Concurrent,
|
|
|
|
_ => throw new InvalidOperationException($"Unknown execution environment {environment}")
|
|
};
|
|
}
|
|
}
|