VertexAIKernelBuilderExtensions.AddVertexAIGeminiChatCompletion Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddVertexAIGeminiChatCompletion(IKernelBuilder, String, Func<ValueTask<String>>, String, String, VertexAIVersion, String, HttpClient) |
Adds Vertex AI Gemini Chat Completion and Text Generation services to the kernel builder. |
AddVertexAIGeminiChatCompletion(IKernelBuilder, String, String, String, String, VertexAIVersion, String, HttpClient) |
Adds Vertex AI Gemini Chat Completion and Text Generation services to the kernel builder. |
AddVertexAIGeminiChatCompletion(IKernelBuilder, String, Func<ValueTask<String>>, String, String, VertexAIVersion, String, HttpClient)
Adds Vertex AI Gemini Chat Completion and Text Generation services to the kernel builder.
public static Microsoft.SemanticKernel.IKernelBuilder AddVertexAIGeminiChatCompletion (this Microsoft.SemanticKernel.IKernelBuilder 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, string? serviceId = default, System.Net.Http.HttpClient? httpClient = default);
static member AddVertexAIGeminiChatCompletion : Microsoft.SemanticKernel.IKernelBuilder * string * Func<System.Threading.Tasks.ValueTask<string>> * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * string * System.Net.Http.HttpClient -> Microsoft.SemanticKernel.IKernelBuilder
<Extension()>
Public Function AddVertexAIGeminiChatCompletion (builder As IKernelBuilder, 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, Optional httpClient As HttpClient = Nothing) As IKernelBuilder
Parameters
- builder
- IKernelBuilder
The kernel builder.
- modelId
- String
The model for text generation.
- location
- String
The location to process the request
- projectId
- String
Your project ID
- apiVersion
- VertexAIVersion
The version of the Vertex API.
- serviceId
- String
The optional service ID.
- httpClient
- HttpClient
The optional custom HttpClient.
Returns
The updated kernel 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
AddVertexAIGeminiChatCompletion(IKernelBuilder, String, String, String, String, VertexAIVersion, String, HttpClient)
Adds Vertex AI Gemini Chat Completion and Text Generation services to the kernel builder.
public static Microsoft.SemanticKernel.IKernelBuilder AddVertexAIGeminiChatCompletion (this Microsoft.SemanticKernel.IKernelBuilder builder, string modelId, string bearerKey, string location, string projectId, Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion apiVersion = Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion.V1, string? serviceId = default, System.Net.Http.HttpClient? httpClient = default);
static member AddVertexAIGeminiChatCompletion : Microsoft.SemanticKernel.IKernelBuilder * string * string * string * string * Microsoft.SemanticKernel.Connectors.Google.VertexAIVersion * string * System.Net.Http.HttpClient -> Microsoft.SemanticKernel.IKernelBuilder
<Extension()>
Public Function AddVertexAIGeminiChatCompletion (builder As IKernelBuilder, 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, Optional httpClient As HttpClient = Nothing) As IKernelBuilder
Parameters
- builder
- IKernelBuilder
The kernel builder.
- 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.
- serviceId
- String
The optional service ID.
- httpClient
- HttpClient
The optional custom HttpClient.
Returns
The updated kernel builder.