Skip to content

AgentResilienceAttribute

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

AgentResilienceAttribute Class

Configures per-agent resilience settings that override the global default set by UsingResilience() on AgentFrameworkSyringe.

public sealed class AgentResilienceAttribute : System.Attribute

Inheritance System.Object 🡒 System.Attribute 🡒 AgentResilienceAttribute

Remarks

Apply this attribute alongside NeedlrAiAgentAttribute to configure agent-specific retry and timeout behaviour.

Constructors

AgentResilienceAttribute(int, int) Constructor

Initialises a new AgentResilienceAttribute.

public AgentResilienceAttribute(int maxRetries=2, int timeoutSeconds=0);

Parameters

maxRetries System.Int32

Maximum number of retry attempts. Defaults to 2.

timeoutSeconds System.Int32

Per-attempt timeout in seconds. 0 means no timeout.

Properties

AgentResilienceAttribute.MaxRetries Property

Gets the maximum number of retry attempts (0 = no retry).

public int MaxRetries { get; }

Property Value

System.Int32

AgentResilienceAttribute.TimeoutSeconds Property

Gets the per-attempt timeout in seconds (0 = no timeout).

public int TimeoutSeconds { get; }

Property Value

System.Int32