Table of Contents

Method Remove

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

Remove(string)

Removes the agent with the specified name from the registry.

public bool Remove(string name)

Parameters

name string

The name of the agent to remove. Case-sensitive.

Returns

bool

true if 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.