AgentResiliencePlugin
NexusLabs.Needlr.AgentFramework.Workflows¶
NexusLabs.Needlr.AgentFramework.Workflows.Middleware¶
AgentResiliencePlugin Class¶
MAF agent-level middleware that wraps each agent run call in a Polly.ResiliencePipeline<> from Microsoft.Extensions.Resilience / Polly.
Inheritance System.Object 🡒 AgentResiliencePlugin
Implements NexusLabs.Needlr.AgentFramework.IAIAgentBuilderPlugin
Remarks¶
This is the right middleware level for agent resilience because it wraps the entire
RunAsync() call and catches LLM failures, tool failures, and orchestration errors
together. Streaming RunStreamingAsync() passes through without retry.
Constructors¶
AgentResiliencePlugin(ResiliencePipeline<AgentResponse>) Constructor¶
Parameters¶
pipeline Polly.ResiliencePipeline<Microsoft.Agents.AI.AgentResponse>
The resilience pipeline to wrap around each RunAsync call.
Methods¶
AgentResiliencePlugin.Configure(AIAgentBuilderPluginOptions) Method¶
Called once per agent creation to configure the builder's middleware pipeline.
Use NexusLabs.Needlr.AgentFramework.AIAgentBuilderPluginOptions.AgentBuilder to add
Use(...) middleware layers.
Parameters¶
options NexusLabs.Needlr.AgentFramework.AIAgentBuilderPluginOptions
Provides access to the AIAgentBuilder for the agent being constructed.
Implements Configure(AIAgentBuilderPluginOptions)