1 write to ChatClient
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
38ChatClient = CreateChatClient();
72 references to ChatClient
Microsoft.Extensions.AI.Integration.Tests (40)
ChatClientIntegrationTests.cs (40)
45ChatClient?.Dispose(); 56var response = await ChatClient.GetResponseAsync("What's the biggest animal?"); 66var response = await ChatClient.GetResponseAsync( 84var response = await ChatClient.GetResponseAsync( 106await foreach (var chunk in ChatClient.GetStreamingResponseAsync(chatHistory)) 121var response = await ChatClient.GetResponseAsync("Explain in 10 words how AI works"); 133var response = ChatClient.GetStreamingResponseAsync("Explain in 10 words how AI works", new() 162var streamingResponse = ChatClient.GetStreamingResponseAsync(history); 181var response = await ChatClient.GetResponseAsync( 199var response = await ChatClient.GetResponseAsync( 225new OpenTelemetryChatClient(ChatClient, sourceName: sourceName)); 248using var chatClient = new FunctionInvokingChatClient(ChatClient); 263using var chatClient = new FunctionInvokingChatClient(ChatClient); 292new OpenTelemetryChatClient(ChatClient, sourceName: sourceName)); 324new OpenTelemetryChatClient(ChatClient, sourceName: sourceName)); 356new OpenTelemetryChatClient(ChatClient, sourceName: sourceName)); 413new OpenTelemetryChatClient(ChatClient, sourceName: sourceName)); 570using var chatClient = new FunctionInvokingChatClient(ChatClient); 603using var chatClient = new FunctionInvokingChatClient(ChatClient); 623using var chatClient = new FunctionInvokingChatClient(ChatClient); 641var firstResponse = await ChatClient.GetResponseAsync([message]); 643var secondResponse = await ChatClient.GetResponseAsync([message]); 653ChatClient, 678ChatClient, 960var response = await ChatClient.GetResponseAsync<Person>(""" 976var response = await ChatClient.GetResponseAsync<Person[]>(""" 992var response = await ChatClient.GetResponseAsync<int>(""" 1005var response = await ChatClient.GetResponseAsync<string>(""" 1018var response = await ChatClient.GetResponseAsync<bool>(""" 1031var response = await ChatClient.GetResponseAsync<bool>(""" 1044var response = await ChatClient.GetResponseAsync<JobType>(""" 1064using var chatClient = new FunctionInvokingChatClient(ChatClient); 1088var captureOutputChatClient = ChatClient.AsBuilder() 1133var chatClient = new TestSummarizingChatClient(ChatClient, targetCount: 2, threshold: 1); 1175var chatClient = new TestSummarizingChatClient(ChatClient, targetCount: 2, threshold: 0); 1232var chatClient = ChatClient 1270var chatClient = new TestSummarizingChatClient(ChatClient, targetCount: 2, threshold: 0); 1315var chatClient = new TestSummarizingChatClient(ChatClient, targetCount: 2, threshold: 0); 1399[MemberNotNull(nameof(ChatClient))] 1404Assert.SkipUnless(skipIntegration is null && ChatClient is not null, "Client is not enabled.");
Microsoft.Extensions.AI.OpenAI.Tests (32)
OpenAIAssistantChatClientIntegrationTests.cs (1)
55var response = await ChatClient.GetResponseAsync("Use the code interpreter to calculate the square root of 42.", new()
OpenAIResponseClientIntegrationTests.cs (31)
38var response = await ChatClient.GetResponseAsync("Use the code interpreter to calculate the square root of 42. Return only the nearest integer value and no other text.", new() 82var response = await ChatClient.GetResponseAsync( 157? await ChatClient.GetStreamingResponseAsync("Generate an image of a simple blue circle on a white background.", chatOptions).ToChatResponseAsync() 158: await ChatClient.GetResponseAsync("Generate an image of a simple blue circle on a white background.", chatOptions); 331ChatResponse response = await ChatClient.GetResponseAsync( 362var response = await ChatClient.GetResponseAsync("What's the biggest animal?", chatOptions); 372response = await ChatClient.GetResponseAsync([], chatOptions); 386using var chatClient = new FunctionInvokingChatClient(ChatClient); 426await foreach (var update in ChatClient.GetStreamingResponseAsync("What is the capital of France?", chatOptions)) 449await foreach (var update in ChatClient.GetStreamingResponseAsync("What is the capital of France?", chatOptions)) 465await foreach (var update in ChatClient.GetStreamingResponseAsync([], chatOptions)) 480using var chatClient = new FunctionInvokingChatClient(ChatClient); 570using var client = new FunctionInvokingChatClient(ChatClient); 594using var client = new FunctionInvokingChatClient(ChatClient); 618using var client = new FunctionInvokingChatClient(ChatClient); 643using var client = new FunctionInvokingChatClient(ChatClient); 671using var client = new FunctionInvokingChatClient(ChatClient); 708var response1 = await ChatClient.GetResponseAsync(chatHistory, chatOptions); 726var response2 = await ChatClient.GetResponseAsync(chatHistory, chatOptions); 745var response3 = await ChatClient.GetResponseAsync(deserializedHistory, chatOptions); 761() => ChatClient.GetResponseAsync(deserializedHistory, chatOptions)); 789var response1 = await ChatClient.GetStreamingResponseAsync(chatHistory, chatOptions).ToChatResponseAsync(); 807var response2 = await ChatClient.GetStreamingResponseAsync(chatHistory, chatOptions).ToChatResponseAsync(); 826var response3 = await ChatClient.GetStreamingResponseAsync(deserializedHistory, chatOptions).ToChatResponseAsync(); 843await foreach (var update in ChatClient.GetStreamingResponseAsync(deserializedHistory, chatOptions)) 861using var client = new FunctionInvokingChatClient(ChatClient); 897ChatClient.GetResponseAsync( 917ChatClient.GetResponseAsync( 944ChatClient.GetResponseAsync( 965using var client = new FunctionInvokingChatClient(ChatClient); 1008using var client = new FunctionInvokingChatClient(ChatClient);