Table of Contents

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

bool

InitializationTask

Gets the TaskCompletionSource<TResult> (TResult of type bool) that signals the completion of the initialization task.

Task<bool> InitializationTask { get; }

Property Value

Task<bool>

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 string

The name of the API handling the request.

controllerName string

The name of the ASP.NET controller handling the request.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing the user identity associated with the request.

completionRequest CompletionRequest

The CompletionRequest providing the completion request details.

Returns

QuotaMetricPartitionState

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 string

The name of the API handling the request.

controllerName string

The name of the ASP.NET controller handling the request.

userIdentity UnifiedUserIdentity

The 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.