| | | 1 | | namespace 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)] |
| | | 16 | | public 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> |
| | 1407 | 26 | | public AgentGroupChatMemberAttribute(string groupName) |
| | | 27 | | { |
| | 1407 | 28 | | ArgumentException.ThrowIfNullOrWhiteSpace(groupName); |
| | 1407 | 29 | | GroupName = groupName; |
| | 1407 | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary>Gets the name of the group chat this agent participates in.</summary> |
| | 42 | 33 | | public string GroupName { get; } |
| | | 34 | | } |