Skip to content

AgentTerminationConditionAttribute

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

AgentTerminationConditionAttribute Class

Declares a termination condition that is wired into the group chat manager for this agent (Layer 1). The condition is evaluated inside MAF's group chat loop, before the next agent turn starts, giving a clean early exit.

public sealed class AgentTerminationConditionAttribute : System.Attribute

Inheritance System.Object 🡒 System.Attribute 🡒 AgentTerminationConditionAttribute

Remarks

Apply to a class also decorated with AgentGroupChatMemberAttribute. Multiple conditions may be stacked; OR semantics apply (first match stops the workflow).

The conditionType must implement IWorkflowTerminationCondition. Constructor arguments for the condition are passed via ctorArgs.\<example> \<code> [AgentGroupChatMember("code-review")] [AgentTerminationCondition(typeof(KeywordTerminationCondition), "APPROVED")] public class ApprovalAgent { } \</code> \</example>

Constructors

AgentTerminationConditionAttribute(Type, object[]) Constructor

Initializes a new instance of AgentTerminationConditionAttribute.

public AgentTerminationConditionAttribute(System.Type conditionType, params object[] ctorArgs);

Parameters

conditionType System.Type

The type that implements IWorkflowTerminationCondition. An instance is created at workflow construction time via System.Activator.CreateInstance(System.Type,System.Object[]) with ctorArgs.

ctorArgs System.Object[]

Arguments forwarded to the condition's constructor. May be empty if the condition has a parameterless constructor.

Properties

AgentTerminationConditionAttribute.ConditionType Property

Gets the type of the termination condition to instantiate.

public System.Type ConditionType { get; }

Property Value

System.Type

AgentTerminationConditionAttribute.CtorArgs Property

Gets the constructor arguments forwarded when instantiating the condition.

public object[] CtorArgs { get; }

Property Value

System.Object[]