Partager via


GoogleAIServiceCollectionExtensions.AddGoogleAIGeminiChatCompletion Method

Definition

Add Google AI Gemini Chat Completion and Text Generation services to the specified service collection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddGoogleAIGeminiChatCompletion (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);
static member AddGoogleAIGeminiChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Microsoft.SemanticKernel.Connectors.Google.GoogleAIVersion * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddGoogleAIGeminiChatCompletion (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) As IServiceCollection

Parameters

services
IServiceCollection

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

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

Optional service ID.

Returns

The updated service collection.

Applies to