Interface IQuotaService
- Namespace
- FoundationaLLM.Common.Interfaces
- Assembly
- FoundationaLLM.Common.dll
Defines methods exposed by the FoundationaLLM Quota service.
public interface IQuotaService
- Extension Methods
Properties
Enabled
Indicates whether the quota service is enabled.
bool Enabled { get; }
Property Value
InitializationTask
Gets the TaskCompletionSource<TResult> (TResult
of type bool)
that signals the completion of the initialization task.
Task<bool> InitializationTask { get; }
Property Value
Remarks
The result of the task indicates whether initialization completed successfully or not.
Methods
EvaluateCompletionRequestForQuota(string, string, UnifiedUserIdentity?, CompletionRequest)
Evaluates a completion request to determine if it exceeds any quotas.
QuotaMetricPartitionState EvaluateCompletionRequestForQuota(string apiName, string controllerName, UnifiedUserIdentity? userIdentity, CompletionRequest completionRequest)
Parameters
apiName
stringThe name of the API handling the request.
controllerName
stringThe name of the ASP.NET controller handling the request.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing the user identity associated with the request.
completionRequest
CompletionRequestThe CompletionRequest providing the completion request details.
Returns
EvaluateRawRequestForQuota(string, string?, UnifiedUserIdentity?)
Evaluates an HTTP API request to determine if it exceeds any quotas.
QuotaMetricPartitionState EvaluateRawRequestForQuota(string apiName, string? controllerName, UnifiedUserIdentity? userIdentity)
Parameters
apiName
stringThe name of the API handling the request.
controllerName
stringThe name of the ASP.NET controller handling the request.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing the user identity associated with the request.
Returns
- QuotaMetricPartitionState
An QuotaMetricPartitionState object that indicates if any quotas where exceeded and provides details in case of a quota breach.