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.
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.
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.
Property Value¶
AgentTerminationConditionAttribute.CtorArgs Property¶
Gets the constructor arguments forwarded when instantiating the condition.