次の方法で共有


ChatClientBuilder クラス

定義

IChatClientのパイプラインを作成するためのビルダー。

public ref class ChatClientBuilder sealed
public sealed class ChatClientBuilder
type ChatClientBuilder = class
Public NotInheritable Class ChatClientBuilder
継承
ChatClientBuilder

コンストラクター

名前 説明
ChatClientBuilder(Func<IServiceProvider,IChatClient>)

ChatClientBuilder クラスの新しいインスタンスを初期化します。

ChatClientBuilder(IChatClient)

ChatClientBuilder クラスの新しいインスタンスを初期化します。

メソッド

名前 説明
Build(IServiceProvider)

パイプライン全体を表す IChatClient をビルドします。 このインスタンスの呼び出しは、各パイプライン ステージを順番に通過します。

Use(Func<IChatClient,IChatClient>)

中間チャット クライアントのファクトリをチャット クライアント パイプラインに追加します。

Use(Func<IChatClient,IServiceProvider,IChatClient>)

中間チャット クライアントのファクトリをチャット クライアント パイプラインに追加します。

Use(Func<IEnumerable<ChatMessage>,ChatOptions,Func<IEnumerable<ChatMessage>,ChatOptions,CancellationToken,Task>,CancellationToken,Task>)

GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)の両方の実装を提供するデリゲートに基づいて、匿名の委任チャット クライアントをチャット クライアント パイプラインに追加します。

Use(Func<IEnumerable<ChatMessage>,ChatOptions,IChatClient,CancellationToken, Task<ChatResponse>>, Func<IEnumerable<ChatMessage>,ChatOptions, IChatClient,CancellationToken,IAsyncEnumerable<ChatResponseUpdate>>)

GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)の両方の実装を提供するデリゲートに基づいて、匿名の委任チャット クライアントをチャット クライアント パイプラインに追加します。

拡張メソッド

名前 説明
ConfigureOptions(ChatClientBuilder, Action<ChatOptions>)

パイプライン内の次のクライアントに渡される ChatOptions を構成するコールバックを追加します。

UseChatReducer(ChatClientBuilder, IChatReducer, Action<ReducingChatClient>)

チャット パイプラインに ReducingChatClient を追加します。

UseDistributedCache(ChatClientBuilder, IDistributedCache, Action<DistributedCachingChatClient>)

パイプラインの次のステージとして DistributedCachingChatClient を追加します。

UseFunctionInvocation(ChatClientBuilder, ILoggerFactory, Action<FunctionInvokingChatClient>)

チャット パイプラインでの関数呼び出しの自動呼び出しを有効にします。

UseImageGeneration(ChatClientBuilder, IImageGenerator, Action<ImageGeneratingChatClient>)

チャット クライアント パイプラインにイメージ生成機能を追加します。

UseLogging(ChatClientBuilder, ILoggerFactory, Action<LoggingChatClient>)

チャット クライアント パイプラインにログ記録を追加します。

UseOpenTelemetry(ChatClientBuilder, ILoggerFactory, String, Action<OpenTelemetryChatClient>)

Generative AI システムの OpenTelemetry セマンティック規則に従って、チャット クライアント パイプラインに OpenTelemetry サポートを追加します。

適用対象