21 instantiations of FunctionInvokingChatClient
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClientBuilderExtensions.cs (1)
36var chatClient = new FunctionInvokingChatClient(innerClient, loggerFactory, services);
Microsoft.Extensions.AI.Integration.Tests (10)
ChatClientIntegrationTests.cs (10)
224using var chatClient = new FunctionInvokingChatClient( 248using var chatClient = new FunctionInvokingChatClient(_chatClient); 263using var chatClient = new FunctionInvokingChatClient(_chatClient); 291using var chatClient = new FunctionInvokingChatClient( 323using var chatClient = new FunctionInvokingChatClient( 379using var chatClient = new FunctionInvokingChatClient( 496using var chatClient = new FunctionInvokingChatClient(_chatClient); 529using var chatClient = new FunctionInvokingChatClient(_chatClient); 549using var chatClient = new FunctionInvokingChatClient(_chatClient); 990using 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);
43 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)
80Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 87Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.Integration.Tests (10)
ChatClientIntegrationTests.cs (10)
224using var chatClient = new FunctionInvokingChatClient( 248using var chatClient = new FunctionInvokingChatClient(_chatClient); 263using var chatClient = new FunctionInvokingChatClient(_chatClient); 291using var chatClient = new FunctionInvokingChatClient( 323using var chatClient = new FunctionInvokingChatClient( 379using var chatClient = new FunctionInvokingChatClient( 496using var chatClient = new FunctionInvokingChatClient(_chatClient); 529using var chatClient = new FunctionInvokingChatClient(_chatClient); 549using var chatClient = new FunctionInvokingChatClient(_chatClient); 990using 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 (8)
OpenAIAssistantChatClientTests.cs (2)
69Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 75Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
OpenAIChatClientTests.cs (4)
77Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 83Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>()); 102Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 108Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
OpenAIResponseClientTests.cs (2)
67Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 73Assert.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);