mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Enable sharing of workflow instances across concurrently executing runs (#1464)
* 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
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.Agents.AI.Workflows;
|
||||
|
||||
@@ -26,6 +27,24 @@ public sealed class WorkflowOutputEvent : WorkflowEvent
|
||||
/// <returns>true if the underlying data is assignable to type T; otherwise, false.</returns>
|
||||
public bool Is<T>() => this.IsType(typeof(T));
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the underlying data is of the specified type or a derived type, and
|
||||
/// returns it as that type if it is.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to compare with the type of the underlying data.</typeparam>
|
||||
/// <returns>true if the underlying data is assignable to type T; otherwise, false.</returns>
|
||||
public bool Is<T>([NotNullWhen(true)] out T? maybeValue)
|
||||
{
|
||||
if (this.Data is T value)
|
||||
{
|
||||
maybeValue = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
maybeValue = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the underlying data is of the specified type or a derived type.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user