Skip to content

NexusLabs.Needlr.AgentFramework.Providers

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Providers Namespace

Classes
AllProvidersFailedException Thrown by ITieredProviderSelector<TQuery,TResult> when at least one provider was registered but every provider failed or was denied by the quota gate.
AlwaysGrantQuotaGate IQuotaGate that always grants reservations. Suitable for development and scenarios where quota tracking is not needed.
NoProvidersAvailableException Base exception type thrown by ITieredProviderSelector<TQuery,TResult> when it cannot return a result because no provider is available to serve the request.
NoProvidersRegisteredException Thrown by ITieredProviderSelector<TQuery,TResult> when no enabled providers were registered, so there is nothing to attempt.
ProviderFailureContext Diagnostic context passed to OnHit when a matching failure policy is applied to a provider's thrown exception.
ProviderFailurePolicy Declarative failure-handling rule applied by TieredProviderSelector<TQuery,TResult> when a provider throws an exception during ExecuteAsync(TQuery, CancellationToken).
ProviderUnavailableException Thrown when a provider is temporarily unavailable. The tiered selector catches this and falls through to the next provider in the chain.
TieredProviderSelector<TQuery,TResult> Default ITieredProviderSelector<TQuery,TResult> that iterates providers in ascending Priority order, gated by an IQuotaGate. Exception handling is configurable via FailurePolicies; the default options (Default) preserve the framework's historical behaviour of falling through to the next provider on ProviderUnavailableException.
TieredProviderSelectorOptions Configuration for TieredProviderSelector<TQuery,TResult> controlling how exceptions thrown by providers are handled.
TieredProviderSelectorServiceCollectionExtensions Extension methods that register an ITieredProviderSelector<TQuery,TResult> with optional consumer-supplied TieredProviderSelectorOptions in the DI container.
Interfaces
IQuotaGate Gates provider access based on quota. Before each provider attempt, the selector calls TryReserveAsync(string, string, CancellationToken). If denied, the provider is skipped. After the attempt, ReleaseAsync(string, string, bool, CancellationToken) reports success or failure.
ITieredProvider<TQuery,TResult> A provider in a priority-ordered fallback chain. Providers are tried in order of ascending Priority until one succeeds or all fail.
ITieredProviderSelector<TQuery,TResult> Executes a query against a priority-ordered chain of ITieredProvider<TQuery,TResult> instances, falling through to the next provider on failure or quota exhaustion.
Delegates
QuotaPartitionSelector(IAgentExecutionContext) Extracts the quota partition key from the current execution context. Used by TieredProviderSelector<TQuery,TResult> to scope quota to the ambient user/tenant without explicit passing at every call site.