ChatClientBuilderServiceCollectionExtensions.AddChatClient Method

Definition

Overloads

AddChatClient(IServiceCollection, IChatClient)

Registers a singleton IChatClient in the IServiceCollection.

AddChatClient(IServiceCollection, Func<IServiceProvider,IChatClient>)

Registers a singleton IChatClient in the IServiceCollection.

AddChatClient(IServiceCollection, IChatClient)

Source:
ChatClientBuilderServiceCollectionExtensions.cs

Registers a singleton IChatClient in the IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::AI::ChatClientBuilder ^ AddChatClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ serviceCollection, Microsoft::Extensions::AI::IChatClient ^ innerClient);
public static Microsoft.Extensions.AI.ChatClientBuilder AddChatClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Microsoft.Extensions.AI.IChatClient innerClient);
static member AddChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.AI.IChatClient -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddChatClient (serviceCollection As IServiceCollection, innerClient As IChatClient) As ChatClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

innerClient
IChatClient

The inner IChatClient that represents the underlying backend.

Returns

A ChatClientBuilder that can be used to build a pipeline around the inner client.

Remarks

The client is registered as a singleton service.

Applies to

AddChatClient(IServiceCollection, Func<IServiceProvider,IChatClient>)

Source:
ChatClientBuilderServiceCollectionExtensions.cs

Registers a singleton IChatClient in the IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::AI::ChatClientBuilder ^ AddChatClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ serviceCollection, Func<IServiceProvider ^, Microsoft::Extensions::AI::IChatClient ^> ^ innerClientFactory);
public static Microsoft.Extensions.AI.ChatClientBuilder AddChatClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Func<IServiceProvider,Microsoft.Extensions.AI.IChatClient> innerClientFactory);
static member AddChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, Microsoft.Extensions.AI.IChatClient> -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddChatClient (serviceCollection As IServiceCollection, innerClientFactory As Func(Of IServiceProvider, IChatClient)) As ChatClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

innerClientFactory
Func<IServiceProvider,IChatClient>

A callback that produces the inner IChatClient that represents the underlying backend.

Returns

A ChatClientBuilder that can be used to build a pipeline around the inner client.

Remarks

The client is registered as a singleton service.

Applies to