EmbeddingGenerationExtensions.AsTextEmbeddingGenerationService Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a ITextEmbeddingGenerationService from a IEmbeddingGenerator<TInput,TEmbedding> where input of String and an embedding of Single.
public static Microsoft.SemanticKernel.Embeddings.ITextEmbeddingGenerationService AsTextEmbeddingGenerationService(this Microsoft.Extensions.AI.IEmbeddingGenerator<string,Microsoft.Extensions.AI.Embedding<float>> generator, IServiceProvider? serviceProvider = default);
static member AsTextEmbeddingGenerationService : Microsoft.Extensions.AI.IEmbeddingGenerator<string, Microsoft.Extensions.AI.Embedding<single>> * IServiceProvider -> Microsoft.SemanticKernel.Embeddings.ITextEmbeddingGenerationService
<Extension()>
Public Function AsTextEmbeddingGenerationService (generator As IEmbeddingGenerator(Of String, Embedding(Of Single)), Optional serviceProvider As IServiceProvider = Nothing) As ITextEmbeddingGenerationService
Parameters
- generator
- IEmbeddingGenerator<String,Embedding<Single>>
Input as string with embedding as floats generator
- serviceProvider
- IServiceProvider
An optional IServiceProvider that can be used to resolve services to use in the instance.
Returns
The ITextEmbeddingGenerationService. If the generator is an ITextEmbeddingGenerationService,
the generator will be returned. Otherwise, a new ITextEmbeddingGenerationService will be created that wraps the generator.