Table of Contents

Class SemanticKernelTextEmbeddingService

Namespace
FoundationaLLM.SemanticKernel.Core.Services
Assembly
FoundationaLLM.SemanticKernel.Core.dll

Generates text embeddings using the Semantic Kernel orchestrator.

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

Constructors

SemanticKernelTextEmbeddingService(IOptions<SemanticKernelTextEmbeddingServiceSettings>, ILoggerFactory)

Creates a new SemanticKernelTextEmbeddingService instance.

public SemanticKernelTextEmbeddingService(IOptions<SemanticKernelTextEmbeddingServiceSettings> options, ILoggerFactory loggerFactory)

Parameters

options IOptions<SemanticKernelTextEmbeddingServiceSettings>

The IOptions<TOptions> providing configuration settings.

loggerFactory ILoggerFactory

The ILoggerFactory 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 = "text-embedding-ada-002", bool Prioritized = false)

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.