Table of Contents

Method GetEnumerator

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

GetEnumerator()

Returns an enumerator that iterates through the registered agents.

public IEnumerator<Agent> GetEnumerator()

Returns

IEnumerator<Agent>

An enumerator that can be used to iterate through the agents in this registry.

Examples

Example: Iterating over all agents

using LMKit.Agents;

var registry = new AgentRegistry();
// ... agents registered ...

foreach (Agent agent in registry)
{
    Console.WriteLine($"Agent: {agent.Identity.Persona ?? "(unnamed)"}");
    Console.WriteLine($"  Has tools: {agent.CanUseTools}");
    Console.WriteLine($"  Can delegate: {agent.CanDelegate}");
}

Remarks

The enumeration order is not guaranteed and may vary between calls. Do not rely on a specific ordering of agents.