// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Threading;
namespace Microsoft.Agents.AI.Hosting;
///
/// Provides a catalog of registered AI agents within the hosting environment.
///
///
/// The agent catalog allows enumeration of all registered agents in the dependency injection container.
/// This is useful for scenarios where you need to discover and interact with multiple agents programmatically.
///
public abstract class AgentCatalog
{
///
/// Initializes a new instance of the class.
///
protected AgentCatalog()
{
}
///
/// Asynchronously retrieves all registered AI agents from the catalog.
///
/// The to monitor for cancellation requests. The default is .
///
/// An asynchronous enumerable of instances representing all registered agents.
/// The enumeration will only include agents that are successfully resolved from the service provider.
///
///
/// This method enumerates through all registered agent names and attempts to resolve each agent
/// from the dependency injection container. Only successfully resolved agents are yielded.
/// The enumeration is lazy and agents are resolved on-demand during iteration.
///
public abstract IAsyncEnumerable GetAgentsAsync(CancellationToken cancellationToken = default);
}