ChatClientBuilderServiceCollectionExtensions.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.
Overloads
AddKeyedChatClient(IServiceCollection, Object, IChatClient) |
Registers a keyed singleton IChatClient in the IServiceCollection. |
AddKeyedChatClient(IServiceCollection, Object, Func<IServiceProvider,IChatClient>) |
Registers a keyed singleton IChatClient in the IServiceCollection. |
AddKeyedChatClient(IServiceCollection, Object, IChatClient)
Registers a keyed singleton IChatClient in the IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::AI::ChatClientBuilder ^ AddKeyedChatClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ serviceCollection, System::Object ^ serviceKey, Microsoft::Extensions::AI::IChatClient ^ innerClient);
public static Microsoft.Extensions.AI.ChatClientBuilder AddKeyedChatClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object serviceKey, Microsoft.Extensions.AI.IChatClient innerClient);
static member AddKeyedChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Microsoft.Extensions.AI.IChatClient -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddKeyedChatClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClient As IChatClient) As ChatClientBuilder
Parameters
- serviceCollection
- IServiceCollection
The IServiceCollection to which the client should be added.
- serviceKey
- Object
The key with which to associate the client.
- 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 scoped service.
Applies to
AddKeyedChatClient(IServiceCollection, Object, Func<IServiceProvider,IChatClient>)
Registers a keyed singleton IChatClient in the IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::AI::ChatClientBuilder ^ AddKeyedChatClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ serviceCollection, System::Object ^ serviceKey, Func<IServiceProvider ^, Microsoft::Extensions::AI::IChatClient ^> ^ innerClientFactory);
public static Microsoft.Extensions.AI.ChatClientBuilder AddKeyedChatClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object serviceKey, Func<IServiceProvider,Microsoft.Extensions.AI.IChatClient> innerClientFactory);
static member AddKeyedChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, Microsoft.Extensions.AI.IChatClient> -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddKeyedChatClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClientFactory As Func(Of IServiceProvider, IChatClient)) As ChatClientBuilder
Parameters
- serviceCollection
- IServiceCollection
The IServiceCollection to which the client should be added.
- serviceKey
- Object
The key with which to associate the client.
- 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 scoped service.