This commit is contained in:
Shyju Krishnankutty
2026-01-13 19:38:26 -08:00
Unverified
parent aea354b09c
commit 4340f37e97
17 changed files with 587 additions and 134 deletions
@@ -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;
}
}
}
}