Method Remove
Remove(string)
Removes the agent with the specified name from the registry.
public bool Remove(string name)
Parameters
namestringThe name of the agent to remove. Case-sensitive.
Returns
- bool
trueif the agent was found and removed; otherwise,false.
Examples
Example: Removing agents dynamically
using LMKit.Agents;
var registry = new AgentRegistry();
// ... agents registered ...
// Remove an agent that is no longer needed
if (registry.Remove("temporary_helper"))
{
Console.WriteLine("Temporary agent removed from registry.");
}
Console.WriteLine($"Remaining agents: {registry.Count}");
Remarks
Returns false for null, empty, or whitespace names without throwing
an exception.
Removing an agent does not dispose it. If the agent holds resources, dispose it separately after removal.