AzureOpenAIServiceCollectionExtensions.AddAzureOpenAITextEmbeddingGeneration 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.
Overloads
AddAzureOpenAITextEmbeddingGeneration(IServiceCollection, String, AzureOpenAIClient, String, String, Nullable<Int32>)
Adds the AzureOpenAITextEmbeddingGenerationService to the IServiceCollection.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAITextEmbeddingGeneration (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, Azure.AI.OpenAI.AzureOpenAIClient? azureOpenAIClient = default, string? serviceId = default, string? modelId = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Azure.AI.OpenAI.AzureOpenAIClient * string * string * Nullable<int> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (services As IServiceCollection, deploymentName As String, Optional azureOpenAIClient As AzureOpenAIClient = Nothing, Optional serviceId As String = Nothing, Optional modelId As String = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection instance to augment.
- deploymentName
- String
Azure OpenAI deployment name, see https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource
- azureOpenAIClient
- AzureOpenAIClient
AzureOpenAIClient to use for the service. If null, one must be available in the service provider when this service is resolved.
- serviceId
- String
A local identifier for the given AI service
- modelId
- String
Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.
Returns
The same instance as services
.
Applies to
AddAzureOpenAITextEmbeddingGeneration(IServiceCollection, String, String, TokenCredential, String, String, Nullable<Int32>)
Adds the AzureOpenAITextEmbeddingGenerationService to the IServiceCollection.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAITextEmbeddingGeneration (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, string endpoint, Azure.Core.TokenCredential credential, string? serviceId = default, string? modelId = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Azure.Core.TokenCredential * string * string * Nullable<int> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (services As IServiceCollection, deploymentName As String, endpoint As String, credential As TokenCredential, Optional serviceId As String = Nothing, Optional modelId As String = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection instance to augment.
- deploymentName
- String
Azure OpenAI deployment name, see https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource
- endpoint
- String
Azure OpenAI deployment URL, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
- credential
- TokenCredential
Token credentials, e.g. DefaultAzureCredential, ManagedIdentityCredential, EnvironmentCredential, etc.
- serviceId
- String
A local identifier for the given AI service
- modelId
- String
Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.
Returns
The same instance as services
.
Applies to
AddAzureOpenAITextEmbeddingGeneration(IServiceCollection, String, String, String, String, String, Nullable<Int32>)
Adds the AzureOpenAITextEmbeddingGenerationService to the IServiceCollection.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAITextEmbeddingGeneration (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, string endpoint, string apiKey, string? serviceId = default, string? modelId = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * string * string * string * Nullable<int> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (services As IServiceCollection, deploymentName As String, endpoint As String, apiKey As String, Optional serviceId As String = Nothing, Optional modelId As String = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection instance to augment.
- deploymentName
- String
Azure OpenAI deployment name, see https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource
- endpoint
- String
Azure OpenAI deployment URL, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
- apiKey
- String
Azure OpenAI API key, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
- serviceId
- String
A local identifier for the given AI service
- modelId
- String
Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart
The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.
Returns
The same instance as services
.