3 instantiations of LoggingChatClient
Microsoft.Extensions.AI (1)
ChatCompletion\LoggingChatClientBuilderExtensions.cs (1)
41
var chatClient = new
LoggingChatClient
(innerClient, loggerFactory.CreateLogger(typeof(LoggingChatClient)));
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\LoggingChatClientTests.cs (2)
20
Assert.Throws<ArgumentNullException>("innerClient", () => new
LoggingChatClient
(null!, NullLogger.Instance));
21
Assert.Throws<ArgumentNullException>("logger", () => new
LoggingChatClient
(new TestChatClient(), null!));
11 references to LoggingChatClient
Microsoft.Extensions.AI (6)
ChatCompletion\LoggingChatClient.cs (1)
28
/// <summary>Initializes a new instance of the <see cref="
LoggingChatClient
"/> class.</summary>
ChatCompletion\LoggingChatClientBuilderExtensions.cs (5)
12
/// <summary>Provides extensions for configuring <see cref="
LoggingChatClient
"/> instances.</summary>
21
/// <param name="configure">An optional callback that can be used to configure the <see cref="
LoggingChatClient
"/> instance.</param>
26
Action<
LoggingChatClient
>? configure = null)
41
var
chatClient = new LoggingChatClient(innerClient, loggerFactory.CreateLogger(typeof(
LoggingChatClient
)));
Microsoft.Extensions.AI.Tests (5)
ChatCompletion\LoggingChatClientTests.cs (5)
29
Assert.Null(innerClient.AsBuilder().UseLogging(NullLoggerFactory.Instance).Build().GetService(typeof(
LoggingChatClient
)));
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
)));