Language

ChatClientBuilderServiceCollectionExtensions.AddKeyedChatClient メソッド

定義

オーバーロード

AddKeyedChatClient(IServiceCollection, Object, IChatClient, ServiceLifetime)

キー付きシングルトン IChatClient を IServiceCollectionに登録します。

public static Microsoft.Extensions.AI.ChatClientBuilder AddKeyedChatClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object? serviceKey, Microsoft.Extensions.AI.IChatClient innerClient, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddKeyedChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Microsoft.Extensions.AI.IChatClient * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddKeyedChatClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClient As IChatClient, Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As ChatClientBuilder

パラメーター

serviceCollection
IServiceCollection

クライアントを追加する IServiceCollection 。

serviceKey
Object

クライアントを関連付けるキー。

innerClient
IChatClient

基になるバックエンドを表す内部 IChatClient 。

lifetime
ServiceLifetime

クライアントのサービスの有効期間。 既定値は Singleton です。

戻り値

内部クライアントの周囲にパイプラインを構築するために使用できる ChatClientBuilder 。

例外

innerClient は nullです。

注釈

クライアントはスコープ付きサービスとして登録されます。

適用対象

AddKeyedChatClient(IServiceCollection, Object, Func<IServiceProvider,IChatClient>, ServiceLifetime)

キー付きシングルトン IChatClient を IServiceCollectionに登録します。

public static Microsoft.Extensions.AI.ChatClientBuilder AddKeyedChatClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object? serviceKey, Func<IServiceProvider,Microsoft.Extensions.AI.IChatClient> innerClientFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddKeyedChatClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, Microsoft.Extensions.AI.IChatClient> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function AddKeyedChatClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClientFactory As Func(Of IServiceProvider, IChatClient), Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As ChatClientBuilder

パラメーター

serviceCollection
IServiceCollection

クライアントを追加する IServiceCollection 。

serviceKey
Object

クライアントを関連付けるキー。

innerClientFactory
Func<IServiceProvider,IChatClient>

基になるバックエンドを表す内部 IChatClient を生成するコールバック。

lifetime
ServiceLifetime

クライアントのサービスの有効期間。 既定値は Singleton です。

戻り値

内部クライアントの周囲にパイプラインを構築するために使用できる ChatClientBuilder 。

例外

innerClientFactory は nullです。

注釈

クライアントはスコープ付きサービスとして登録されます。

適用対象