156 references to Text
Aspire.Azure.AI.OpenAI.Tests (1)
Aspire.OpenAI.Tests (2)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.Abstractions.Tests (4)
Microsoft.Extensions.AI.AzureAIInference.Tests (7)
Microsoft.Extensions.AI.Evaluation (1)
Microsoft.Extensions.AI.Evaluation.NLP (6)
Microsoft.Extensions.AI.Evaluation.Quality (12)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
Microsoft.Extensions.AI.Evaluation.Safety (1)
Microsoft.Extensions.AI.Integration.Tests (43)
ChatClientIntegrationTests.cs (42)
68Assert.Contains("whale", response.Text, StringComparison.OrdinalIgnoreCase);
85Assert.Contains("America", response.Text);
86Assert.Contains("Asia", response.Text);
102Assert.Contains("3", response.Text);
201Assert.True(response.Text.IndexOf("net", StringComparison.OrdinalIgnoreCase) >= 0, response.Text);
219Assert.True(response.Text.IndexOf("hello", StringComparison.OrdinalIgnoreCase) >= 0, response.Text);
249Assert.Contains(secretNumber.ToString(), response.Text);
265Assert.Contains("3528", response.Text);
317Assert.Contains(secretNumber.ToString(), response.Text);
349Assert.Contains((secretNumber + 19).ToString(), response.Text);
596Regex.IsMatch(response.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase),
597$"Doesn't contain three: {response.Text}");
653Assert.NotEqual(firstResponse.Text, secondResponse.Text);
744Assert.Contains("101", response.Text);
751Assert.Equal(response.Text, secondResponse.Text);
783Assert.Contains("58", response.Text);
793Assert.Equal(response.Text, secondResponse.Text);
825Assert.Contains("81", response.Text);
834Assert.Contains("82", secondResponse.Text);
1171Assert.Contains("Alice", response.Text);
1173response.Text.IndexOf("hiking", StringComparison.OrdinalIgnoreCase) >= 0 ||
1174response.Text.IndexOf("hike", StringComparison.OrdinalIgnoreCase) >= 0,
1175$"Expected 'hiking' or 'hike' in response: {response.Text}");
1215response.Text.IndexOf("arr", StringComparison.OrdinalIgnoreCase) >= 0 ||
1216response.Text.IndexOf("aye", StringComparison.OrdinalIgnoreCase) >= 0 ||
1217response.Text.IndexOf("matey", StringComparison.OrdinalIgnoreCase) >= 0 ||
1218response.Text.IndexOf("ye", StringComparison.OrdinalIgnoreCase) >= 0,
1219$"Expected pirate speak in response: {response.Text}");
1265Assert.True(response.Text.IndexOf("Miami", StringComparison.OrdinalIgnoreCase) >= 0, $"Expected 'Miami' in response: {response.Text}");
1267response.Text.IndexOf("sunny", StringComparison.OrdinalIgnoreCase) >= 0 ||
1268response.Text.IndexOf("better", StringComparison.OrdinalIgnoreCase) >= 0 ||
1269response.Text.IndexOf("warm", StringComparison.OrdinalIgnoreCase) >= 0,
1270$"Expected weather comparison in response: {response.Text}");
1355Assert.Contains("5", response.Text);
1624Assert.DoesNotContain("Sunny and dry.", secondResponse.Text, StringComparison.OrdinalIgnoreCase);
1682capturedAnalysis = response.Text;
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (2)
Microsoft.Extensions.AI.OpenAI.Tests (48)
OpenAIChatClientTests.cs (11)
162Assert.Equal("Hello! How can I assist you today?", response.Text);
418Assert.Equal("Hello! How can I assist you today?", response.Text);
576Assert.Equal("Hello! How can I assist you today?", response.Text);
836Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text);
934Assert.Equal("Hi! It's so good to hear from you!", response.Text);
1032Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text);
1145Assert.Empty(response.Text);
1229Assert.Equal("December 31, 2023", response.Text);
1485Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text);
1599Assert.Equal("The logo says \".NET\", which is a software development framework created by Microsoft. It is used for building and running applications on Windows, macOS, and Linux environments. The logo typically also represents the broader .NET ecosystem, which includes various programming languages, libraries, and tools.", response.Text);
1686Assert.Equal("Hello! How can I assist you today?", response.Text);
OpenAIResponseClientIntegrationTests.cs (19)
110Assert.Contains("read_wiki_structure", response.Text);
111Assert.Contains("read_wiki_contents", response.Text);
112Assert.Contains("ask_question", response.Text);
149Assert.Contains("src/Libraries/Microsoft.Extensions.AI.Abstractions/README.md", response.Text);
218Assert.Contains("src/Libraries/Microsoft.Extensions.AI.Abstractions/README.md", response.Text);
247Assert.Contains("whale", response.Text, StringComparison.OrdinalIgnoreCase);
281Assert.Contains("5:43", response.Text, StringComparison.OrdinalIgnoreCase);
446Assert.Contains("42", response.Text);
474Assert.Contains("72", response.Text);
495response.Text.Contains("logo", StringComparison.OrdinalIgnoreCase) ||
496response.Text.Contains("purple", StringComparison.OrdinalIgnoreCase) ||
497response.Text.Contains("dot", StringComparison.OrdinalIgnoreCase) ||
498response.Text.Contains("net", StringComparison.OrdinalIgnoreCase),
499$"Expected response to mention logo or colors, but got: {response.Text}");
519Assert.Contains("Hello World", response.Text, StringComparison.OrdinalIgnoreCase);
548response.Text.Contains("analysis", StringComparison.OrdinalIgnoreCase) ||
549response.Text.Contains("image", StringComparison.OrdinalIgnoreCase) ||
550response.Text.Contains("logo", StringComparison.OrdinalIgnoreCase),
551$"Expected response to mention analysis or image content, but got: {response.Text}");
OpenAIResponseClientTests.cs (18)
161Assert.Equal("Hello! How can I assist you today?", response.Text);
839Assert.Equal("Hello! How can I assist you today?", response.Text);
2089Assert.Equal("The background response result.", response.Text);
3542Assert.Equal("Hello! How can I assist you today?", response.Text);
3667Assert.Equal("Done", response.Text);
3729Assert.Equal("Processed", response.Text);
3787Assert.Equal("Image processed", response.Text);
3844Assert.Equal("URI processed", response.Text);
3901Assert.Equal("File processed", response.Text);
3965Assert.Equal("Mixed content processed", response.Text);
4023Assert.Equal("PDF processed", response.Text);
4078Assert.Equal("Object processed", response.Text);
4133Assert.Equal("String processed", response.Text);
4190Assert.Equal("File URI processed", response.Text);
4247Assert.Equal("Hosted file processed", response.Text);
4420Assert.Equal("Done", response.Text);
4452Assert.Equal("Partial", response.Text);
4727Assert.Equal("Ok", response.Text);
Microsoft.Extensions.AI.Tests (25)
ChatCompletion\DistributedCachingChatClientTest.cs (15)
157Assert.Equal("Hello", (await result1).Text);
158Assert.Equal("Hello", (await result2).Text);
163Assert.Equal("Hello", (await result3).Text);
234Assert.Equal("A good result", result2.Text);
579Assert.Equal("value 1", result1.Text);
580Assert.Equal("value 1", result2.Text);
594Assert.Equal("value 1", result3.Text);
595Assert.Equal("value 2", result4.Text);
622Assert.Equal("1", result1.Text);
623Assert.Equal("1", result2.Text);
632Assert.Equal("2", result3.Text);
633Assert.Equal("2", result4.Text);
641Assert.Equal("1", result5.Text);
676Assert.Equal("value 1", result1.Text);
677Assert.Equal("value 2", result2.Text);