Partager via


AzureOpenAIKernelBuilderExtensions.AddAzureOpenAITextEmbeddingGeneration Method

Definition

Overloads

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, AzureOpenAIClient, String, String, Nullable<Int32>)

Adds the AzureOpenAITextEmbeddingGenerationService to the Services.

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, String, TokenCredential, String, String, HttpClient, Nullable<Int32>)

Adds the AzureOpenAITextEmbeddingGenerationService to the Services.

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, String, String, String, String, HttpClient, Nullable<Int32>)

Adds the AzureOpenAITextEmbeddingGenerationService to the Services.

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, AzureOpenAIClient, String, String, Nullable<Int32>)

public static Microsoft.SemanticKernel.IKernelBuilder AddAzureOpenAITextEmbeddingGeneration (this Microsoft.SemanticKernel.IKernelBuilder builder, string deploymentName, Azure.AI.OpenAI.AzureOpenAIClient? azureOpenAIClient = default, string? serviceId = default, string? modelId = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.SemanticKernel.IKernelBuilder * string * Azure.AI.OpenAI.AzureOpenAIClient * string * string * Nullable<int> -> Microsoft.SemanticKernel.IKernelBuilder
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (builder As IKernelBuilder, 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 IKernelBuilder

Parameters

builder
IKernelBuilder

The IKernelBuilder instance to augment.

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

dimensions
Nullable<Int32>

The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.

Returns

The same instance as builder.

Applies to

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, String, TokenCredential, String, String, HttpClient, Nullable<Int32>)

public static Microsoft.SemanticKernel.IKernelBuilder AddAzureOpenAITextEmbeddingGeneration (this Microsoft.SemanticKernel.IKernelBuilder builder, string deploymentName, string endpoint, Azure.Core.TokenCredential credential, string? serviceId = default, string? modelId = default, System.Net.Http.HttpClient? httpClient = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.SemanticKernel.IKernelBuilder * string * string * Azure.Core.TokenCredential * string * string * System.Net.Http.HttpClient * Nullable<int> -> Microsoft.SemanticKernel.IKernelBuilder
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (builder As IKernelBuilder, deploymentName As String, endpoint As String, credential As TokenCredential, Optional serviceId As String = Nothing, Optional modelId As String = Nothing, Optional httpClient As HttpClient = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IKernelBuilder

Parameters

builder
IKernelBuilder

The IKernelBuilder instance to augment.

credential
TokenCredential

Token credentials, e.g. DefaultAzureCredential, ManagedIdentityCredential, EnvironmentCredential, etc.

serviceId
String

A local identifier for the given AI service

httpClient
HttpClient

The HttpClient to use with this service.

dimensions
Nullable<Int32>

The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.

Returns

The same instance as builder.

Applies to

AddAzureOpenAITextEmbeddingGeneration(IKernelBuilder, String, String, String, String, String, HttpClient, Nullable<Int32>)

public static Microsoft.SemanticKernel.IKernelBuilder AddAzureOpenAITextEmbeddingGeneration (this Microsoft.SemanticKernel.IKernelBuilder builder, string deploymentName, string endpoint, string apiKey, string? serviceId = default, string? modelId = default, System.Net.Http.HttpClient? httpClient = default, int? dimensions = default);
static member AddAzureOpenAITextEmbeddingGeneration : Microsoft.SemanticKernel.IKernelBuilder * string * string * string * string * string * System.Net.Http.HttpClient * Nullable<int> -> Microsoft.SemanticKernel.IKernelBuilder
<Extension()>
Public Function AddAzureOpenAITextEmbeddingGeneration (builder As IKernelBuilder, deploymentName As String, endpoint As String, apiKey As String, Optional serviceId As String = Nothing, Optional modelId As String = Nothing, Optional httpClient As HttpClient = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IKernelBuilder

Parameters

builder
IKernelBuilder

The IKernelBuilder instance to augment.

serviceId
String

A local identifier for the given AI service

httpClient
HttpClient

The HttpClient to use with this service.

dimensions
Nullable<Int32>

The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.

Returns

The same instance as builder.

Applies to