20 instantiations of FunctionInvokingChatClient
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClientBuilderExtensions.cs (1)
36var chatClient = new FunctionInvokingChatClient(innerClient, loggerFactory, services);
Microsoft.Extensions.AI.Integration.Tests (9)
ChatClientIntegrationTests.cs (9)
216using var chatClient = new FunctionInvokingChatClient( 249using var chatClient = new FunctionInvokingChatClient(_chatClient); 264using var chatClient = new FunctionInvokingChatClient(_chatClient); 292using var chatClient = new FunctionInvokingChatClient( 333using var chatClient = new FunctionInvokingChatClient( 376using var chatClient = new FunctionInvokingChatClient( 419using var chatClient = new FunctionInvokingChatClient(_chatClient); 452using var chatClient = new FunctionInvokingChatClient(_chatClient); 472using var chatClient = new FunctionInvokingChatClient(_chatClient);
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\FunctionInvokingChatClientTests.cs (10)
26Assert.Throws<ArgumentNullException>("innerClient", () => new FunctionInvokingChatClient(null!)); 34using FunctionInvokingChatClient client = new(innerClient); 115s => new FunctionInvokingChatClient(s) { AllowConcurrentInvocation = concurrentInvocation }); 163s => new FunctionInvokingChatClient(s) { AllowConcurrentInvocation = true }); 450s => new FunctionInvokingChatClient(s) { IncludeDetailedErrors = detailedErrors }); 477b.Use((c, services) => new FunctionInvokingChatClient(c, services.GetRequiredService<ILoggerFactory>())); 533new FunctionInvokingChatClient(new OpenTelemetryChatClient(c, sourceName: sourceName))); 615using var client = new FunctionInvokingChatClient(innerClient); 657using var client = new FunctionInvokingChatClient(innerClient); 778using var chatClient = new FunctionInvokingChatClient(innerChatClient);
40 references to FunctionInvokingChatClient
Aspire.Azure.AI.OpenAI.Tests (1)
AspireConfigurableOpenAIExtensionsTests.cs (1)
247Assert.IsType<FunctionInvokingChatClient>(chatClient);
Microsoft.Extensions.AI (13)
ChatCompletion\FunctionInvocationContext.cs (1)
70/// The initial request to the client that passes along the chat contents provided to the <see cref="FunctionInvokingChatClient"/>
ChatCompletion\FunctionInvokingChatClient.cs (7)
53/// <summary>Gets the <see cref="IServiceProvider"/> specified when constructing the <see cref="FunctionInvokingChatClient"/>, if any.</summary> 70/// Initializes a new instance of the <see cref="FunctionInvokingChatClient"/> class. 78_logger = (ILogger?)loggerFactory?.CreateLogger<FunctionInvokingChatClient>() ?? NullLogger.Instance; 149/// Each request to this <see cref="FunctionInvokingChatClient"/> might end up making 183/// When function invocations fail with an exception, the <see cref="FunctionInvokingChatClient"/> 216using Activity? activity = _activitySource?.StartActivity($"{nameof(FunctionInvokingChatClient)}.{nameof(GetResponseAsync)}"); 311using Activity? activity = _activitySource?.StartActivity($"{nameof(FunctionInvokingChatClient)}.{nameof(GetStreamingResponseAsync)}");
ChatCompletion\FunctionInvokingChatClientBuilderExtensions.cs (5)
12/// Provides extension methods for attaching a <see cref="FunctionInvokingChatClient"/> to a chat pipeline. 19/// <remarks>This works by adding an instance of <see cref="FunctionInvokingChatClient"/> with default options.</remarks> 22/// <param name="configure">An optional callback that can be used to configure the <see cref="FunctionInvokingChatClient"/> instance.</param> 28Action<FunctionInvokingChatClient>? configure = null) 36var chatClient = new FunctionInvokingChatClient(innerClient, loggerFactory, services);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
66Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 73Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.Integration.Tests (9)
ChatClientIntegrationTests.cs (9)
216using var chatClient = new FunctionInvokingChatClient( 249using var chatClient = new FunctionInvokingChatClient(_chatClient); 264using var chatClient = new FunctionInvokingChatClient(_chatClient); 292using var chatClient = new FunctionInvokingChatClient( 333using var chatClient = new FunctionInvokingChatClient( 376using var chatClient = new FunctionInvokingChatClient( 419using var chatClient = new FunctionInvokingChatClient(_chatClient); 452using var chatClient = new FunctionInvokingChatClient(_chatClient); 472using var chatClient = new FunctionInvokingChatClient(_chatClient);
Microsoft.Extensions.AI.Ollama.Tests (2)
OllamaChatClientTests.cs (2)
58Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 64Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIChatClientTests.cs (4)
75Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 81Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>()); 100Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 106Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
OpenAIResponseClientTests.cs (2)
65Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 71Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.Tests (7)
ChatCompletion\FunctionInvokingChatClientTests.cs (7)
34using FunctionInvokingChatClient client = new(innerClient); 615using var client = new FunctionInvokingChatClient(innerClient); 657using var client = new FunctionInvokingChatClient(innerClient); 679var context = FunctionInvokingChatClient.CurrentContext!; 719Assert.Null(FunctionInvokingChatClient.CurrentContext); 756FunctionInvokingChatClient.CurrentContext!.Terminate = true; 778using var chatClient = new FunctionInvokingChatClient(innerChatClient);