Partager via


VertexAIMemoryBuilderExtensions.WithVertexAITextEmbeddingGeneration Method

Definition

Overloads

WithVertexAITextEmbeddingGeneration(MemoryBuilder, String, Func<ValueTask<String>>, String, String, VertexAIVersion, HttpClient)

Add VertexAI embeddings generation service to the memory builder.

WithVertexAITextEmbeddingGeneration(MemoryBuilder, String, String, String, String, VertexAIVersion, HttpClient)

Add VertexAI embeddings generation service to the memory builder.

WithVertexAITextEmbeddingGeneration(MemoryBuilder, String, Func<ValueTask<String>>, String, String, VertexAIVersion, HttpClient)

Add VertexAI embeddings generation service to the memory builder.

public static Microsoft.SemanticKernel.Memory.MemoryBuilder WithVertexAITextEmbeddingGeneration (this Microsoft.SemanticKernel.Memory.MemoryBuilder builder, string modelId, Func<System.Threading.Tasks.ValueTask<string>> bearerTokenProvider, string location, string projectId, Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion apiVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, System.Net.Http.HttpClient? httpClient = default);
static member WithVertexAITextEmbeddingGeneration : Microsoft.SemanticKernel.Memory.MemoryBuilder * string * Func<System.Threading.Tasks.ValueTask<string>> * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * System.Net.Http.HttpClient -> Microsoft.SemanticKernel.Memory.MemoryBuilder
<Extension()>
Public Function WithVertexAITextEmbeddingGeneration (builder As MemoryBuilder, modelId As String, bearerTokenProvider As Func(Of ValueTask(Of String)), location As String, projectId As String, Optional apiVersion As VertexAIVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, Optional httpClient As HttpClient = Nothing) As MemoryBuilder

Parameters

builder
MemoryBuilder

The MemoryBuilder instance

modelId
String

The model for text generation.

bearerTokenProvider
Func<ValueTask<String>>

The Bearer Key provider for authentication.

location
String

The location to process the request

projectId
String

Your project ID

apiVersion
VertexAIVersion

The version of the Vertex API.

httpClient
HttpClient

The optional custom HttpClient.

Returns

The updated memory builder.

Remarks

This bearerTokenProvider will be called on every request, when providing the token consider using caching strategy and refresh token logic when it is expired or close to expiration.

Applies to

WithVertexAITextEmbeddingGeneration(MemoryBuilder, String, String, String, String, VertexAIVersion, HttpClient)

Add VertexAI embeddings generation service to the memory builder.

public static Microsoft.SemanticKernel.Memory.MemoryBuilder WithVertexAITextEmbeddingGeneration (this Microsoft.SemanticKernel.Memory.MemoryBuilder builder, string modelId, string bearerKey, string location, string projectId, Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion apiVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, System.Net.Http.HttpClient? httpClient = default);
static member WithVertexAITextEmbeddingGeneration : Microsoft.SemanticKernel.Memory.MemoryBuilder * string * string * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * System.Net.Http.HttpClient -> Microsoft.SemanticKernel.Memory.MemoryBuilder
<Extension()>
Public Function WithVertexAITextEmbeddingGeneration (builder As MemoryBuilder, modelId As String, bearerKey As String, location As String, projectId As String, Optional apiVersion As VertexAIVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, Optional httpClient As HttpClient = Nothing) As MemoryBuilder

Parameters

builder
MemoryBuilder

The MemoryBuilder instance

modelId
String

The model for text generation.

bearerKey
String

The Bearer Key for authentication.

location
String

The location to process the request

projectId
String

Your project ID

apiVersion
VertexAIVersion

The version of the Vertex API.

httpClient
HttpClient

The optional custom HttpClient.

Returns

The updated memory builder.

Applies to