13 instantiations of ChatClientBuilder
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientBuilderChatClientExtensions.cs (1)
23
return new
ChatClientBuilder
(innerClient);
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (2)
35
var builder = new
ChatClientBuilder
(innerClientFactory);
67
var builder = new
ChatClientBuilder
(innerClientFactory);
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\ChatClientBuilderTest.cs (5)
19
var builder = new
ChatClientBuilder
(services =>
40
var builder = new
ChatClientBuilder
(expectedInnerClient);
61
Assert.Throws<ArgumentNullException>("innerClient", () => new
ChatClientBuilder
((IChatClient)null!));
68
Assert.Throws<ArgumentNullException>("innerClientFactory", () => new
ChatClientBuilder
((Func<IServiceProvider, IChatClient>)null!));
75
ChatClientBuilder builder =
new
(innerClient);
ChatCompletion\UseDelegateChatClientTests.cs (5)
19
ChatClientBuilder builder =
new
(client);
63
using IChatClient client = new
ChatClientBuilder
(innerClient)
103
using IChatClient client = new
ChatClientBuilder
(innerClient)
145
using IChatClient client = new
ChatClientBuilder
(innerClient)
205
using 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>
64
public
ChatClientBuilder
Use(Func<IChatClient, IChatClient> clientFactory)
73
/// <returns>The updated <see cref="
ChatClientBuilder
"/> instance.</returns>
74
public
ChatClientBuilder
Use(Func<IChatClient, IServiceProvider, IChatClient> clientFactory)
92
/// <returns>The updated <see cref="
ChatClientBuilder
"/> instance.</returns>
98
public
ChatClientBuilder
Use(AnonymousDelegatingChatClient.CompleteSharedFunc sharedFunc)
119
/// <returns>The updated <see cref="
ChatClientBuilder
"/> instance.</returns>
131
public
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,
19
public 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>
18
public static
ChatClientBuilder
AddChatClient(
26
/// <returns>A <see cref="
ChatClientBuilder
"/> that can be used to build a pipeline around the inner client.</returns>
28
public static
ChatClientBuilder
AddChatClient(
35
var
builder = new ChatClientBuilder(innerClientFactory);
44
/// <returns>A <see cref="
ChatClientBuilder
"/> that can be used to build a pipeline around the inner client.</returns>
46
public static
ChatClientBuilder
AddKeyedChatClient(
56
/// <returns>A <see cref="
ChatClientBuilder
"/> that can be used to build a pipeline around the inner client.</returns>
58
public static
ChatClientBuilder
AddKeyedChatClient(
67
var
builder = new ChatClientBuilder(innerClientFactory);
ChatCompletion\ConfigureOptionsChatClientBuilderExtensions.cs (3)
17
/// <param name="builder">The <see cref="
ChatClientBuilder
"/>.</param>
28
public static
ChatClientBuilder
ConfigureOptions(
29
this
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>
25
public 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>
24
public static
ChatClientBuilder
UseFunctionInvocation(
25
this
ChatClientBuilder
builder,
ChatCompletion\LoggingChatClientBuilderExtensions.cs (3)
15
/// <param name="builder">The <see cref="
ChatClientBuilder
"/>.</param>
22
public static
ChatClientBuilder
UseLogging(
23
this
ChatClientBuilder
builder,
ChatCompletion\OpenTelemetryChatClientBuilderExtensions.cs (3)
21
/// <param name="builder">The <see cref="
ChatClientBuilder
"/>.</param>
26
public static
ChatClientBuilder
UseOpenTelemetry(
27
this
ChatClientBuilder
builder,
Microsoft.Extensions.AI.Tests (26)
ChatCompletion\ChatClientBuilderTest.cs (3)
19
var
builder = new ChatClientBuilder(services =>
40
var
builder = new ChatClientBuilder(expectedInnerClient);
75
ChatClientBuilder
builder = new(innerClient);
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
26
var
builder = innerClient.AsBuilder();
ChatCompletion\FunctionInvokingChatClientTests.cs (19)
26
Assert.Throws<ArgumentNullException>("builder", () => ((
ChatClientBuilder
)null!).UseFunctionInvocation());
114
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { ConcurrentInvocation = concurrentInvocation });
154
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { ConcurrentInvocation = true });
235
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(client => new FunctionInvokingChatClient(client) { KeepFunctionCallingMessages = keepFunctionCallingMessages });
281
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(client => new FunctionInvokingChatClient(client) { KeepFunctionCallingMessages = keepFunctionCallingMessages });
343
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(s => new FunctionInvokingChatClient(s) { DetailedErrors = detailedErrors });
407
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b =>
463
Func<
ChatClientBuilder
,
ChatClientBuilder
> configure = b => b.Use(c =>
501
Func<
ChatClientBuilder
,
ChatClientBuilder
>? configurePipeline = null,
570
Func<
ChatClientBuilder
,
ChatClientBuilder
>? configurePipeline = null,
ChatCompletion\SingletonChatClientExtensions.cs (2)
8
public static
ChatClientBuilder
UseSingletonMiddleware(this
ChatClientBuilder
builder)
ChatCompletion\UseDelegateChatClientTests.cs (1)
19
ChatClientBuilder
builder = new(client);