95 references to Text
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderChatClientExtensionsTests.cs (1)
218Assert.Equal("Hello from middleware", completion.Text);
Aspire.OpenAI.Tests (2)
AspireOpenAIClientBuilderChatClientExtensionsTests.cs (2)
221Assert.Equal("Hello from middleware", completion.Text); 255Assert.Equal("Hello from middleware", completion.Text);
Microsoft.Extensions.AI (2)
ChatCompletion\ChatResponse{T}.cs (2)
19/// You can access the underlying JSON response on the <see cref="ChatResponse.Text"/> property. 130var json = Text;
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponse.cs (1)
104public override string ToString() => Text;
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\ChatResponseTests.cs (3)
21Assert.Empty(response.Text); 25Assert.Empty(response.Text); 124Assert.Equal(response.Text, response.ToString());
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (1)
65Assert.Equal("Hello, world!", response.Text);
Microsoft.Extensions.AI.AzureAIInference.Tests (7)
AzureAIInferenceChatClientTests.cs (7)
156Assert.Equal("Hello! How can I assist you today?", response.Text); 261Assert.Equal("Hello! How can I assist you today?", response.Text); 370Assert.Equal("Hello! How can I assist you today?", response.Text); 537Assert.Equal("Hello! How can I assist you today?", response.Text); 1005Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text); 1140Assert.Equal("Hello.", response.Text); 1256Assert.Empty(response.Text);
Microsoft.Extensions.AI.Evaluation (1)
ChatResponseExtensions.cs (1)
20/// This function only considers the <see cref="ChatResponse.Text"/> and ignores any <see cref="AIContent"/>s
Microsoft.Extensions.AI.Evaluation.Quality (11)
CoherenceEvaluator.cs (1)
80if (string.IsNullOrWhiteSpace(modelResponse.Text))
CompletenessEvaluator.cs (1)
77if (string.IsNullOrWhiteSpace(modelResponse.Text))
EquivalenceEvaluator.cs (1)
76if (string.IsNullOrWhiteSpace(modelResponse.Text))
EvaluationMetricExtensions.cs (2)
43string evaluationResponseText = evaluationResponse.Text.Trim(); 55string evaluationResponseText = evaluationResponse.Text.Trim();
FluencyEvaluator.cs (1)
74if (string.IsNullOrWhiteSpace(modelResponse.Text))
GroundednessEvaluator.cs (1)
75if (string.IsNullOrWhiteSpace(modelResponse.Text))
RelevanceEvaluator.cs (1)
88if (string.IsNullOrWhiteSpace(modelResponse.Text))
RelevanceTruthAndCompletenessEvaluator.cs (2)
105if (string.IsNullOrWhiteSpace(modelResponse.Text)) 276string evaluationResponseText = evaluationResponse.Text.Trim();
Utilities\JsonOutputFixer.cs (1)
77return response.Text.Trim();
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
ScenarioRunResultTests.cs (1)
312=> obj.Text.GetHashCode();
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyEvaluator.cs (1)
151string annotationResult = annotationResponse.Text;
Microsoft.Extensions.AI.Integration.Tests (25)
ChatClientIntegrationTests.cs (24)
52Assert.Contains("whale", response.Text, StringComparison.OrdinalIgnoreCase); 69Assert.Contains("America", response.Text); 70Assert.Contains("Asia", response.Text); 86Assert.Contains("3", response.Text); 185Assert.True(response.Text.IndexOf("net", StringComparison.OrdinalIgnoreCase) >= 0, response.Text); 203Assert.True(response.Text.IndexOf("hello", StringComparison.OrdinalIgnoreCase) >= 0, response.Text); 233Assert.Contains(secretNumber.ToString(), response.Text); 249Assert.Contains("3528", response.Text); 301Assert.Contains(secretNumber.ToString(), response.Text); 333Assert.Contains((secretNumber + 19).ToString(), response.Text); 426Regex.IsMatch(response.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase), 427$"Doesn't contain three: {response.Text}"); 483Assert.NotEqual(firstResponse.Text, secondResponse.Text); 574Assert.Contains("101", response.Text); 581Assert.Equal(response.Text, secondResponse.Text); 613Assert.Contains("58", response.Text); 621Assert.Equal(response.Text, secondResponse.Text); 655Assert.Contains("81", response.Text); 664Assert.Contains("82", secondResponse.Text);
PromptBasedFunctionCallingChatClient.cs (1)
85if (result.Text is { } content
Microsoft.Extensions.AI.Ollama.Tests (7)
OllamaChatClientIntegrationTests.cs (2)
50Assert.Contains(secretNumber.ToString(), response.Text); 84Assert.Contains("999", response.Text);
OllamaChatClientTests.cs (5)
122Assert.Equal("Hello! How are you today? Is there something", response.Text); 210Assert.Equal("Hello! How are you today? Is there something I can help you with or would you like to", chatResponse.Text); 291VerbatimHttpHandler.RemoveWhiteSpace(response.Text)); 380Assert.Empty(response.Text); 477Assert.Equal("Alice is 42 years old.", response.Text);
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIChatClientTests.cs (10)
168Assert.Equal("Hello! How can I assist you today?", response.Text); 358Assert.Equal("Hello! How can I assist you today?", response.Text); 520Assert.Equal("Hello! How can I assist you today?", response.Text); 780Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text); 878Assert.Equal("Hi! It's so good to hear from you!", response.Text); 976Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text); 1089Assert.Empty(response.Text); 1173Assert.Equal("December 31, 2023", response.Text); 1429Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Text); 1543Assert.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);
OpenAIResponseClientTests.cs (2)
163Assert.Equal("Hello! How can I assist you today?", response.Text); 404Assert.Equal("Hello! How can I assist you today?", response.Text);
Microsoft.Extensions.AI.Tests (20)
ChatCompletion\DistributedCachingChatClientTest.cs (10)
133Assert.Equal("Hello", (await result1).Text); 134Assert.Equal("Hello", (await result2).Text); 139Assert.Equal("Hello", (await result3).Text); 210Assert.Equal("A good result", result2.Text); 555Assert.Equal("value 1", result1.Text); 556Assert.Equal("value 1", result2.Text); 570Assert.Equal("value 1", result3.Text); 571Assert.Equal("value 2", result4.Text); 606Assert.Equal("value 1", result1.Text); 607Assert.Equal("value 2", result2.Text);
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
662Assert.Equal("The answer is 42.", response.Text); 796Assert.Equal("The search results were 'dogs'", result.Text);
ChatCompletion\UseDelegateChatClientTests.cs (8)
68Assert.Equal("hello", response.Text); 72Assert.Equal("world", response.Text); 111Assert.Equal("hello world", response.Text); 114Assert.Equal("hello world", response.Text); 162Assert.Equal("hello world", response.Text); 165Assert.Equal("hello world", response.Text); 233Assert.Equal("non-streaming hello world (non-streaming)", response.Text); 236Assert.Equal("streaming hello world (streaming)", response.Text);