Table of Contents

Class AzureOpenAITextEmbeddingService

Namespace
FoundationaLLM.Gateway.Services
Assembly
FoundationaLLM.Gateway.dll

Implementation of ITextEmbeddingService using Azure OpenAI.

public class AzureOpenAITextEmbeddingService : ITextEmbeddingService
Inheritance
AzureOpenAITextEmbeddingService
Implements
Inherited Members
Extension Methods

Constructors

AzureOpenAITextEmbeddingService(string, ILogger<AzureOpenAITextEmbeddingService>)

Initializes a new instance of the AzureOpenAITextEmbeddingService class.

public AzureOpenAITextEmbeddingService(string accountEndpoint, ILogger<AzureOpenAITextEmbeddingService> logger)

Parameters

accountEndpoint string

The endpoint of the Azure OpenAI service.

logger ILogger<AzureOpenAITextEmbeddingService>

Methods

GetEmbeddingsAsync(IList<TextChunk>, string, int, bool)

Initializes the text embedding operation. Depending on the implementation, this can be an atomic operation or a long-running one.

public Task<TextEmbeddingResult> GetEmbeddingsAsync(IList<TextChunk> textChunks, string deploymentName, int embeddingDimensions, bool prioritized)

Parameters

textChunks IList<TextChunk>

The list of text chunks which need to be embedded.

deploymentName string

The name of the model deployment to use for embedding.

embeddingDimensions int

The number of dimensions for the embedding model.

prioritized bool

Indicates whether the request should be prioritized.

Returns

Task<TextEmbeddingResult>

A TextEmbeddingResult object containing the result of the text embedding operation.

GetEmbeddingsAsync(string)

Retrieves the result of a long-running text embedding operation.

public Task<TextEmbeddingResult> GetEmbeddingsAsync(string operationId)

Parameters

operationId string

The unique identifier of the long-running operation.

Returns

Task<TextEmbeddingResult>

A TextEmbeddingResult object containing the result of the text embedding operation.