mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding * Switch to more modern Record type-tree for Sum Types * Unify APIs for getting ExecutorBinding * Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently. * feat: Simplify function-to-executor pattern * refactor: Normalize API naming
19 lines
638 B
C#
19 lines
638 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
|
|
|
|
internal sealed record class ExecutorInfo(TypeId ExecutorType, string ExecutorId)
|
|
{
|
|
public bool IsMatch<T>() where T : Executor =>
|
|
this.ExecutorType.IsMatch<T>()
|
|
&& this.ExecutorId == typeof(T).Name;
|
|
|
|
public bool IsMatch(Executor executor) =>
|
|
this.ExecutorType.IsMatch(executor.GetType())
|
|
&& this.ExecutorId == executor.Id;
|
|
|
|
public bool IsMatch(ExecutorBinding binding) =>
|
|
this.ExecutorType.IsMatch(binding.ExecutorType)
|
|
&& this.ExecutorId == binding.Id;
|
|
}
|