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
optionsIOptions<SemanticKernelTextEmbeddingServiceSettings>The IOptions<TOptions> providing configuration settings.
loggerFactoryILoggerFactoryThe ILoggerFactory used to create loggers for logging.
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<TextOperationResult> GetEmbeddingsAsync(IList<TextChunk> textChunks, string modelName = "text-embedding-ada-002", int embeddingDimensions = 1536, bool Prioritized = false)
Parameters
textChunksIList<TextChunk>The list of text chunks which need to be embedded.
modelNamestringembeddingDimensionsintThe number of dimensions for the embedding model.
Prioritizedbool
Returns
- Task<TextOperationResult>
A TextOperationResult object containing the result of the text embedding operation.
GetEmbeddingsAsync(string)
Retrieves the result of a long-running text embedding operation.
public Task<TextOperationResult> GetEmbeddingsAsync(string operationId)
Parameters
operationIdstringThe unique identifier of the long-running operation.
Returns
- Task<TextOperationResult>
A TextOperationResult object containing the result of the text embedding operation.