次の方法で共有


VertexAIServiceCollectionExtensions.AddVertexAIEmbeddingGeneration Method

Definition

Overloads

AddVertexAIEmbeddingGeneration(IServiceCollection, String, Func<ValueTask<String>>, String, String, VertexAIVersion, String)

Adds Vertex AI embeddings generation service to the specified service collection.

AddVertexAIEmbeddingGeneration(IServiceCollection, String, String, String, String, VertexAIVersion, String)

Adds Vertex AI embeddings generation service to the specified service collection.

AddVertexAIEmbeddingGeneration(IServiceCollection, String, Func<ValueTask<String>>, String, String, VertexAIVersion, String)

Adds Vertex AI embeddings generation service to the specified service collection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddVertexAIEmbeddingGeneration (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, 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, string? serviceId = default);
static member AddVertexAIEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<System.Threading.Tasks.ValueTask<string>> * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddVertexAIEmbeddingGeneration (services As IServiceCollection, 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 serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

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

modelId
String

The model for embeddings 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.

serviceId
String

Optional service ID.

Returns

The updated service collection.

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

AddVertexAIEmbeddingGeneration(IServiceCollection, String, String, String, String, VertexAIVersion, String)

Adds Vertex AI embeddings generation service to the specified service collection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddVertexAIEmbeddingGeneration (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string modelId, string bearerKey, string location, string projectId, Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion apiVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, string? serviceId = default);
static member AddVertexAIEmbeddingGeneration : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddVertexAIEmbeddingGeneration (services As IServiceCollection, modelId As String, bearerKey As String, location As String, projectId As String, Optional apiVersion As VertexAIVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, Optional serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

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

modelId
String

The model for embeddings 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.

serviceId
String

Optional service ID.

Returns

The updated service collection.

Applies to