mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -204,4 +204,24 @@ public class Workflow
|
||||
.ConfigureAwait(false);
|
||||
return startExecutor.DescribeProtocol();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumerates all AIAgent instances that are directly bound in this workflow.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method only returns agents that are directly bound as executor values.
|
||||
/// It does not include agents created by factory functions, as those require
|
||||
/// an IServiceProvider to instantiate.
|
||||
/// </remarks>
|
||||
/// <returns>An enumerable collection of AIAgent instances found in the workflow.</returns>
|
||||
public IEnumerable<AIAgent> EnumerateAgentExecutors()
|
||||
{
|
||||
foreach (ExecutorBinding binding in this.ExecutorBindings.Values)
|
||||
{
|
||||
if (binding.RawValue is AIAgent agent)
|
||||
{
|
||||
yield return agent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user