Freigeben über


GoogleAIServiceCollectionExtensions.AddGoogleAIEmbeddingGeneration Method

Definition

Add Google AI embeddings generation service to the specified service collection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddGoogleAIEmbeddingGeneration(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string modelId, string apiKey, Microsoft.SemanticKernel.Connectors.Google.GoogleAIVersion apiVersion = Microsoft.SemanticKernel.Connectors.Google.GoogleAIVersion.V1_Beta, string? serviceId = default, int? dimensions = default);
static member AddGoogleAIEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Microsoft.SemanticKernel.Connectors.Google.GoogleAIVersion * string * Nullable<int> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddGoogleAIEmbeddingGeneration (services As IServiceCollection, modelId As String, apiKey As String, Optional apiVersion As GoogleAIVersion = Microsoft.SemanticKernel.Connectors.Google.GoogleAIVersion.V1_Beta, Optional serviceId As String = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The service collection to add the Gemini Embeddings Generation service to.

modelId
String

The model for embeddings generation.

apiKey
String

The API key for authentication Gemini API.

apiVersion
GoogleAIVersion

The version of the Google API.

serviceId
String

Optional service ID.

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 service collection.

Applies to