26 references to Build
Microsoft.Extensions.AI (2)
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (2)
36
_ = serviceCollection.AddSingleton(builder.
Build
);
68
_ = serviceCollection.AddKeyedSingleton(serviceKey, (services, _) => builder.
Build
(services));
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
87
.
Build
();
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientIntegrationTests.cs (2)
39
.
Build
();
64
.
Build
();
OllamaChatClientTests.cs (1)
56
.
Build
();
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (2)
103
.
Build
();
128
.
Build
();
Microsoft.Extensions.AI.Tests (18)
ChatCompletion\ChatClientBuilderTest.cs (4)
32
Assert.Same(expectedOuterClient, builder.
Build
(expectedServiceProvider));
47
var first = (InnerClientCapturingChatClient)builder.
Build
();
77
var ex = Assert.Throws<InvalidOperationException>(() => builder.
Build
());
96
builder.
Build
();
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
74
.
Build
();
ChatCompletion\FunctionInvokingChatClientTests.cs (3)
373
IChatClient service = innerClient.AsBuilder().UseFunctionInvocation().
Build
();
586
IChatClient service = configurePipeline(innerClient.AsBuilder()).
Build
(services);
676
IChatClient service = configurePipeline(innerClient.AsBuilder()).
Build
(services);
ChatCompletion\LoggingChatClientTests.cs (6)
29
Assert.Null(innerClient.AsBuilder().UseLogging(NullLoggerFactory.Instance).
Build
().GetService(typeof(LoggingChatClient)));
30
Assert.Same(innerClient, innerClient.AsBuilder().UseLogging(NullLoggerFactory.Instance).
Build
().GetService(typeof(IChatClient)));
33
Assert.NotNull(innerClient.AsBuilder().UseLogging(factory).
Build
().GetService(typeof(LoggingChatClient)));
38
Assert.NotNull(innerClient.AsBuilder().UseLogging().
Build
(services).GetService(typeof(LoggingChatClient)));
39
Assert.NotNull(innerClient.AsBuilder().UseLogging(null).
Build
(services).GetService(typeof(LoggingChatClient)));
40
Assert.Null(innerClient.AsBuilder().UseLogging(NullLoggerFactory.Instance).
Build
(services).GetService(typeof(LoggingChatClient)));
ChatCompletion\UseDelegateChatClientTests.cs (4)
72
.
Build
();
114
.
Build
();
165
.
Build
();
236
.
Build
();