13 instantiations of ChatClientBuilder
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientBuilderChatClientExtensions.cs (1)
23return new ChatClientBuilder(innerClient);
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (2)
35var builder = new ChatClientBuilder(innerClientFactory); 67var builder = new ChatClientBuilder(innerClientFactory);
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\ChatClientBuilderTest.cs (5)
19var builder = new ChatClientBuilder(services => 40var builder = new ChatClientBuilder(expectedInnerClient); 61Assert.Throws<ArgumentNullException>("innerClient", () => new ChatClientBuilder((IChatClient)null!)); 68Assert.Throws<ArgumentNullException>("innerClientFactory", () => new ChatClientBuilder((Func<IServiceProvider, IChatClient>)null!)); 75ChatClientBuilder builder = new(innerClient);
ChatCompletion\UseDelegateChatClientTests.cs (5)
19ChatClientBuilder builder = new(client); 63using IChatClient client = new ChatClientBuilder(innerClient) 103using IChatClient client = new ChatClientBuilder(innerClient) 145using IChatClient client = new ChatClientBuilder(innerClient) 205using IChatClient client = new ChatClientBuilder(innerClient)
68 references to ChatClientBuilder
Microsoft.Extensions.AI (42)
ChatCompletion\ChatClientBuilder.cs (11)
20/// <summary>Initializes a new instance of the <see cref="ChatClientBuilder"/> class.</summary> 28/// <summary>Initializes a new instance of the <see cref="ChatClientBuilder"/> class.</summary> 53$"The {nameof(ChatClientBuilder)} entry at index {i} returned null. " + 63/// <returns>The updated <see cref="ChatClientBuilder"/> instance.</returns> 64public ChatClientBuilder Use(Func<IChatClient, IChatClient> clientFactory) 73/// <returns>The updated <see cref="ChatClientBuilder"/> instance.</returns> 74public ChatClientBuilder Use(Func<IChatClient, IServiceProvider, IChatClient> clientFactory) 92/// <returns>The updated <see cref="ChatClientBuilder"/> instance.</returns> 98public ChatClientBuilder Use(AnonymousDelegatingChatClient.CompleteSharedFunc sharedFunc) 119/// <returns>The updated <see cref="ChatClientBuilder"/> instance.</returns> 131public ChatClientBuilder Use(
ChatCompletion\ChatClientBuilderChatClientExtensions.cs (5)
9/// <summary>Provides extension methods for working with <see cref="IChatClient"/> in the context of <see cref="ChatClientBuilder"/>.</summary> 12/// <summary>Creates a new <see cref="ChatClientBuilder"/> using <paramref name="innerClient"/> as its inner client.</summary> 14/// <returns>The new <see cref="ChatClientBuilder"/> instance.</returns> 16/// This method is equivalent to using the <see cref="ChatClientBuilder"/> constructor directly, 19public static ChatClientBuilder AsBuilder(this IChatClient innerClient)
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (10)
16/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner client.</returns> 18public static ChatClientBuilder AddChatClient( 26/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner client.</returns> 28public static ChatClientBuilder AddChatClient( 35var builder = new ChatClientBuilder(innerClientFactory); 44/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner client.</returns> 46public static ChatClientBuilder AddKeyedChatClient( 56/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner client.</returns> 58public static ChatClientBuilder AddKeyedChatClient( 67var builder = new ChatClientBuilder(innerClientFactory);
ChatCompletion\ConfigureOptionsChatClientBuilderExtensions.cs (3)
17/// <param name="builder">The <see cref="ChatClientBuilder"/>.</param> 28public static ChatClientBuilder ConfigureOptions( 29this ChatClientBuilder builder, Action<ChatOptions> configure)
ChatCompletion\DistributedCachingChatClientBuilderExtensions.cs (4)
19/// <param name="builder">The <see cref="ChatClientBuilder"/>.</param> 24/// <returns>The <see cref="ChatClientBuilder"/> provided as <paramref name="builder"/>.</returns> 25public static ChatClientBuilder UseDistributedCache(this ChatClientBuilder builder, IDistributedCache? storage = null, Action<DistributedCachingChatClient>? configure = null)
ChatCompletion\FunctionInvokingChatClientBuilderExtensions.cs (3)
20/// <param name="builder">The <see cref="ChatClientBuilder"/> being used to build the chat pipeline.</param> 24public static ChatClientBuilder UseFunctionInvocation( 25this ChatClientBuilder builder,
ChatCompletion\LoggingChatClientBuilderExtensions.cs (3)
15/// <param name="builder">The <see cref="ChatClientBuilder"/>.</param> 22public static ChatClientBuilder UseLogging( 23this ChatClientBuilder builder,
ChatCompletion\OpenTelemetryChatClientBuilderExtensions.cs (3)
21/// <param name="builder">The <see cref="ChatClientBuilder"/>.</param> 26public static ChatClientBuilder UseOpenTelemetry( 27this ChatClientBuilder builder,
Microsoft.Extensions.AI.Tests (26)
ChatCompletion\ChatClientBuilderTest.cs (3)
19var builder = new ChatClientBuilder(services => 40var builder = new ChatClientBuilder(expectedInnerClient); 75ChatClientBuilder builder = new(innerClient);
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
26var builder = innerClient.AsBuilder();
ChatCompletion\FunctionInvokingChatClientTests.cs (19)
26Assert.Throws<ArgumentNullException>("builder", () => ((ChatClientBuilder)null!).UseFunctionInvocation()); 114Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { ConcurrentInvocation = concurrentInvocation }); 154Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { ConcurrentInvocation = true }); 235Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(client => new FunctionInvokingChatClient(client) { KeepFunctionCallingMessages = keepFunctionCallingMessages }); 281Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(client => new FunctionInvokingChatClient(client) { KeepFunctionCallingMessages = keepFunctionCallingMessages }); 343Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { DetailedErrors = detailedErrors }); 407Func<ChatClientBuilder, ChatClientBuilder> configure = b => 463Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(c => 501Func<ChatClientBuilder, ChatClientBuilder>? configurePipeline = null, 570Func<ChatClientBuilder, ChatClientBuilder>? configurePipeline = null,
ChatCompletion\SingletonChatClientExtensions.cs (2)
8public static ChatClientBuilder UseSingletonMiddleware(this ChatClientBuilder builder)
ChatCompletion\UseDelegateChatClientTests.cs (1)
19ChatClientBuilder builder = new(client);