Class QuotaMiddleware
- Namespace
- FoundationaLLM.Common.Middleware
- Assembly
- FoundationaLLM.Common.dll
Middleware that enforces API request quotas.
public class QuotaMiddleware
- Inheritance
-
QuotaMiddleware
- Inherited Members
- Extension Methods
Constructors
QuotaMiddleware(RequestDelegate)
Initializes a new instance of the CallContextMiddleware class.
public QuotaMiddleware(RequestDelegate next)
Parameters
next
RequestDelegate
Methods
InvokeAsync(HttpContext, IOrchestrationContext, IQuotaService, IOptions<InstanceSettings>)
Executes the middleware.
public Task InvokeAsync(HttpContext context, IOrchestrationContext callContext, IQuotaService quotaService, IOptions<InstanceSettings> instanceSettings)
Parameters
context
HttpContextThe current HTTP request context.
callContext
IOrchestrationContextStores context information extracted from the current HTTP request. This information is primarily used to inject HTTP headers into downstream HTTP calls.
quotaService
IQuotaServiceProvides services for managing quotas.
instanceSettings
IOptions<InstanceSettings>Contains the FoundationaLLM instance configuration settings.