Skip to content

ToolFunctionSource

NexusLabs.Needlr.AgentFramework.Testing

ToolFunctionSource Enum

Identifies which discovery path produced an Microsoft.Extensions.AI.AIFunction resolved by ToolInvocationRunner.

public enum ToolFunctionSource

Fields

Generated 0

The function was produced by the source-generated NexusLabs.Needlr.AgentFramework.IAIFunctionProvider registered via NexusLabs.Needlr.AgentFramework.AgentFrameworkGeneratedBootstrap.RegisterAIFunctionProvider(NexusLabs.Needlr.AgentFramework.IAIFunctionProvider). This is the same path the production Microsoft.Agents.AI.AIAgent takes.

Reflection 1

The function was produced by reflection-based discovery via Microsoft.Extensions.AI.AIFunctionFactory. Used only when the runner has been explicitly opted into reflection fallback (which is incompatible with NativeAOT).

Remarks

Surfacing the source on every ToolInvocationResult lets tests assert that they are exercising the source-generated wrapper path and not silently falling through to reflection-based discovery — the production path uses the generated wrapper, so a test that only ever hits the reflection branch can pass while the wrapper has bugs.