AgentFunctionGroupAttribute
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework¶
AgentFunctionGroupAttribute Class¶
Assigns a class to a named function group so that it can be wired to agents by group name rather than by explicit type reference.
Inheritance System.Object 🡒 System.Attribute 🡒 AgentFunctionGroupAttribute
Example¶
[AgentFunctionGroup("research")]
public class GeographyFunctions { ... }
[AgentFunctionGroup("research")]
[AgentFunctionGroup("general")]
public class FactFunctions { ... }
// At agent creation:
agentFactory.CreateAgent(opts => opts.FunctionGroups = ["research"]);
Remarks¶
Apply this attribute to classes that contain methods decorated with
AgentFunctionAttribute. Register groups using
AddAgentFunctionGroupsFromAssemblies() or AddAgentFunctionGroupsFromGenerated(),
then reference them in FunctionGroups at agent creation time.
A class may belong to multiple groups by applying this attribute more than once.
Constructors¶
AgentFunctionGroupAttribute(string) Constructor¶
Initializes a new instance of AgentFunctionGroupAttribute.
Parameters¶
groupName System.String
The name of the group this class belongs to.
Properties¶
AgentFunctionGroupAttribute.GroupName Property¶
Gets the name of the group this class belongs to.