Compartilhar via


GoogleAIKernelBuilderExtensions.AddGoogleAIEmbeddingGeneration Method

Definition

Add Google AI embeddings generation service to the kernel builder.

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

Parameters

builder
IKernelBuilder

The kernel builder.

modelId
String

The model for text generation.

apiKey
String

The API key for authentication Gemini API.

apiVersion
GoogleAIVersion

The version of the Google API.

serviceId
String

The optional service ID.

httpClient
HttpClient

The optional custom HttpClient.

dimensions
Nullable<Int32>

The optional number of dimensions that the model should use. If not specified, the default number of dimensions will be used.

Returns

The updated kernel builder.

Applies to