AspireOpenAIClientBuilderChatClientExtensions.AddKeyedChatClient 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.
Registers a keyed singleton IChatClient in the services provided by the builder
.
public static Microsoft.Extensions.AI.ChatClientBuilder AddKeyedChatClient(this Aspire.OpenAI.AspireOpenAIClientBuilder builder, string serviceKey, string? deploymentName = default);
static member AddKeyedChatClient : Aspire.OpenAI.AspireOpenAIClientBuilder * string * string -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddKeyedChatClient (builder As AspireOpenAIClientBuilder, serviceKey As String, Optional deploymentName As String = Nothing) As ChatClientBuilder
Parameters
- builder
- AspireOpenAIClientBuilder
- serviceKey
- String
The service key with which the IChatClient will be registered.
- deploymentName
- String
Optionally specifies which model deployment to use. If not specified, a value will be taken from the connection string.
Returns
A ChatClientBuilder that can be used to build a pipeline around the inner IChatClient.