Skip to content
Docs Try Aspire

AspireOpenAIClientBuilderEmbeddingGeneratorExtensions Methods

Class Methods 2 members
Provides extension methods for registering AI.IEmbeddingGenerator`2 as a singleton in the services provided by the Hosting.IHostApplicationBuilder.
AddEmbeddingGenerator(AspireOpenAIClientBuilder, string?) Section titled AddEmbeddingGenerator(AspireOpenAIClientBuilder, string?) extension EmbeddingGeneratorBuilder<string, Embedding<float>>
Registers a singleton AI.IEmbeddingGenerator`2 in the services provided by the builder.
public static class AspireOpenAIClientBuilderEmbeddingGeneratorExtensions
{
public static EmbeddingGeneratorBuilder<string, Embedding<float>> AddEmbeddingGenerator(
this AspireOpenAIClientBuilder builder,
string? deploymentName = null)
{
// ...
}
}
deploymentName string? optional Optionally specifies which model deployment to use. If not specified, a value will be taken from the connection string.
EmbeddingGeneratorBuilder<string, Embedding<float>> A AI.EmbeddingGeneratorBuilder`2 that can be used to build a pipeline around the inner AI.IEmbeddingGenerator`2.
AddKeyedEmbeddingGenerator(AspireOpenAIClientBuilder, string, string?) Section titled AddKeyedEmbeddingGenerator(AspireOpenAIClientBuilder, string, string?) extension EmbeddingGeneratorBuilder<string, Embedding<float>>
Registers a keyed singleton AI.IEmbeddingGenerator`2 in the services provided by the builder.
public static class AspireOpenAIClientBuilderEmbeddingGeneratorExtensions
{
public static EmbeddingGeneratorBuilder<string, Embedding<float>> AddKeyedEmbeddingGenerator(
this AspireOpenAIClientBuilder builder,
string serviceKey,
string? deploymentName = null)
{
// ...
}
}
serviceKey string The service key with which the AI.IEmbeddingGenerator`2 will be registered.
deploymentName string? optional Optionally specifies which model deployment to use. If not specified, a value will be taken from the connection string.
EmbeddingGeneratorBuilder<string, Embedding<float>> A AI.EmbeddingGeneratorBuilder`2 that can be used to build a pipeline around the inner AI.IEmbeddingGenerator`2.