Skip to content

IAgentFrameworkFunctionScanner

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

IAgentFrameworkFunctionScanner Interface

Discovers types containing methods decorated with AgentFunctionAttribute. The source generator emits GeneratedAgentFunctionScanner at compile time; in reflection mode, a runtime scanner is used instead.

public interface IAgentFrameworkFunctionScanner

Derived
GeneratedAgentFunctionScanner

Example

// Typically resolved from DI — not called directly by application code.
var scanner = serviceProvider.GetRequiredService<IAgentFrameworkFunctionScanner>();
var functionTypes = scanner.ScanForFunctionTypes();
Console.WriteLine($"Found {functionTypes.Count} types with [AgentFunction] methods");

Remarks

The discovered types are passed to IAgentFactory so that agent creation can resolve tool functions from them. Each type may contain multiple [AgentFunction] methods, and each method becomes an AIFunction available to agents that reference the type's function group.

Methods

IAgentFrameworkFunctionScanner.ScanForFunctionTypes() Method

Returns all types that contain at least one method decorated with AgentFunctionAttribute. The returned list is used by the agent factory to build the tool set for each agent.

System.Collections.Generic.IReadOnlyList<System.Type> ScanForFunctionTypes();

Returns

System.Collections.Generic.IReadOnlyList<System.Type>