Table of Contents

Class GatewayTextEmbeddingService

Namespace
FoundationaLLM.Vectorization.Services.Text
Assembly
FoundationaLLM.Vectorization.Engine.dll

Generates text embeddings by routing requests through the FoundationaLLM Gateway API.

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

Constructors

GatewayTextEmbeddingService(IOptions<InstanceSettings>, IHttpClientFactoryService, ILoggerFactory)

Generates text embeddings by routing requests through the FoundationaLLM Gateway API.

public GatewayTextEmbeddingService(IOptions<InstanceSettings> instanceOptions, IHttpClientFactoryService httpClientFactoryService, ILoggerFactory loggerFactory)

Parameters

instanceOptions IOptions<InstanceSettings>

The options providing the InstanceSettings with instance settings.

httpClientFactoryService IHttpClientFactoryService

The HTTP Client Factory service.

loggerFactory ILoggerFactory

The logger factory used to create loggers for logging.

Methods

GetEmbeddingsAsync(IList<TextChunk>, string, 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 modelName, bool Prioritized)

Parameters

textChunks IList<TextChunk>

The list of text chunks which need to be embedded.

modelName string
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.