Udostępnij za pośrednictwem


GoogleAIMemoryBuilderExtensions.WithGoogleAITextEmbeddingGeneration Method

Definition

Add GoogleAI embeddings generation service to the memory builder.

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

Parameters

builder
MemoryBuilder

The MemoryBuilder instance

modelId
String

The model for text generation.

apiKey
String

The API key for authentication Gemini API.

apiVersion
GoogleAIVersion

The version of the Google API.

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 memory builder.

Applies to