Skip to content
Docs Try Aspire

AspireOpenAIClientBuilderChatClientExtensions Methods

Class Methods 2 members
Provides extension methods for registering AI.IChatClient as a singleton in the services provided by the Hosting.IHostApplicationBuilder.
AddChatClient(AspireOpenAIClientBuilder, string?) Section titled AddChatClient(AspireOpenAIClientBuilder, string?) extension ChatClientBuilder
Registers a singleton AI.IChatClient in the services provided by the builder.
public static class AspireOpenAIClientBuilderChatClientExtensions
{
public static ChatClientBuilder AddChatClient(
this AspireOpenAIClientBuilder builder,
string? deploymentName = null)
{
// ...
}
}
deploymentName string? optional Optionally specifies which model deployment to use. If not specified, a value will be taken from the connection string.
ChatClientBuilder A AI.ChatClientBuilder that can be used to build a pipeline around the inner AI.IChatClient.
AddKeyedChatClient(AspireOpenAIClientBuilder, string, string?) Section titled AddKeyedChatClient(AspireOpenAIClientBuilder, string, string?) extension ChatClientBuilder
Registers a keyed singleton AI.IChatClient in the services provided by the builder.
public static class AspireOpenAIClientBuilderChatClientExtensions
{
public static ChatClientBuilder AddKeyedChatClient(
this AspireOpenAIClientBuilder builder,
string serviceKey,
string? deploymentName = null)
{
// ...
}
}
serviceKey string The service key with which the AI.IChatClient will be registered.
deploymentName string? optional Optionally specifies which model deployment to use. If not specified, a value will be taken from the connection string.
ChatClientBuilder A AI.ChatClientBuilder that can be used to build a pipeline around the inner AI.IChatClient.