< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.AgentGroupChatMemberAttribute
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/AgentGroupChatMemberAttribute.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 34
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_GroupName()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/AgentGroupChatMemberAttribute.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework;
 2
 3/// <summary>
 4/// Declares that a <see cref="NeedlrAiAgentAttribute"/>-annotated agent participates in a named
 5/// group chat workflow. Apply this attribute to include the agent in a round-robin group chat
 6/// created via <see cref="IWorkflowFactory.CreateGroupChatWorkflow"/>.
 7/// </summary>
 8/// <remarks>
 9/// When the <c>NexusLabs.Needlr.AgentFramework.Generators</c> package is referenced, the source
 10/// generator emits a strongly-typed extension method (e.g. <c>CreateCodeReviewGroupChatWorkflow</c>)
 11/// on <see cref="IWorkflowFactory"/> for each unique group name declared across all agent types.
 12/// The generated method encapsulates the group name string so the composition root never references
 13/// it directly.
 14/// </remarks>
 15[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
 16public sealed class AgentGroupChatMemberAttribute : Attribute
 17{
 18    /// <summary>
 19    /// Initializes a new instance of <see cref="AgentGroupChatMemberAttribute"/>.
 20    /// </summary>
 21    /// <param name="groupName">
 22    /// The name of the group chat this agent participates in. Must match exactly (case-sensitive)
 23    /// when calling <see cref="IWorkflowFactory.CreateGroupChatWorkflow"/>. Use the generated
 24    /// extension method to avoid referencing the string directly.
 25    /// </param>
 140726    public AgentGroupChatMemberAttribute(string groupName)
 27    {
 140728        ArgumentException.ThrowIfNullOrWhiteSpace(groupName);
 140729        GroupName = groupName;
 140730    }
 31
 32    /// <summary>Gets the name of the group chat this agent participates in.</summary>
 4233    public string GroupName { get; }
 34}