180 references to Text
Aspire.Dashboard (7)
Model\Assistant\InitialPrompt.cs (1)
12
: this(icon, buttonTitle, buttonDescription, (context) => { context.ChatBuilder.AddUserMessage(chatDisplayText, promptMessage.
Text
); return Task.CompletedTask; })
Model\Assistant\Prompts\PromptContextsBuilder.cs (6)
23
KnownChatMessages.Traces.CreateErrorTracesMessage(errorTraces.Items, outgoingPeerResolvers).
Text
);
38
KnownChatMessages.StructuredLogs.CreateErrorStructuredLogsMessage(errorLogs.Items).
Text
);
47
KnownChatMessages.Resources.CreateAnalyzeResourceMessage(resource).
Text
);
57
KnownChatMessages.StructuredLogs.CreateAnalyzeLogEntryMessage(logEntry).
Text
);
82
KnownChatMessages.Traces.CreateAnalyzeTraceMessage(trace, traceLogs.Items, outgoingPeerResolvers).
Text
);
107
KnownChatMessages.Traces.CreateAnalyzeSpanMessage(span, traceLogs.Items, outgoingPeerResolvers).
Text
);
AzureAIFoundryEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
121
__builder.AddContent(5, message.
Text
AzureOpenAIEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
121
__builder.AddContent(5, message.
Text
GitHubModelsEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
121
__builder.AddContent(5, message.
Text
Microsoft.Extensions.AI (1)
ChatCompletion\ChatResponse{T}.cs (1)
128
var json = Messages.Count > 0 ? Messages[Messages.Count - 1].
Text
: string.Empty;
Microsoft.Extensions.AI.Abstractions (6)
ChatCompletion\ChatMessage.cs (2)
106
public override string ToString() =>
Text
;
114
string text =
Text
;
ChatCompletion\ChatResponse.cs (1)
57
/// This property concatenates the <see cref="ChatMessage.
Text
"/> of all <see cref="ChatMessage"/>
Contents\AIContentExtensions.cs (3)
62
/// <summary>Concatenates the <see cref="ChatMessage.
Text
"/> of all <see cref="ChatMessage"/> instances in the list.</summary>
73
return messages[0].
Text
;
100
string text = messages[i].
Text
;
Microsoft.Extensions.AI.Abstractions.Tests (49)
AssertExtensions.cs (2)
27
Assert.Equal(expectedMessage.
Text
, chatMessage.
Text
);
ChatCompletion\ChatClientExtensionsTests.cs (2)
113
Assert.Equal("hello", m.
Text
);
140
Assert.Equal("hello", m.
Text
);
ChatCompletion\ChatMessageTests.cs (9)
22
Assert.Empty(message.
Text
);
65
Assert.Empty(message.
Text
);
69
Assert.Empty(message.
Text
);
73
Assert.Empty(message.
Text
);
77
Assert.Empty(message.
Text
);
101
Assert.Empty(message.
Text
);
112
Assert.Equal(string.Concat(Enumerable.Range(0, messageCount).Select(i => $"text-{i}")), message.
Text
);
156
Assert.Equal("text-1text-2", message.
Text
);
161
Assert.Equal("text-3text-2", message.
Text
);
ChatCompletion\ChatResponseTests.cs (1)
104
Assert.Equal("the message", result.Messages.Single().
Text
);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (35)
95
Assert.Equal("!a", response.Messages[0].
Text
);
98
Assert.Equal("b", response.Messages[1].
Text
);
101
Assert.Equal("cd", response.Messages[2].
Text
);
104
Assert.Equal("e", response.Messages[3].
Text
);
107
Assert.Equal("fg", response.Messages[4].
Text
);
110
Assert.Equal("h", response.Messages[5].
Text
);
113
Assert.Equal("i", response.Messages[6].
Text
);
116
Assert.Equal("jkl", response.Messages[7].
Text
);
119
Assert.Equal("m", response.Messages[8].
Text
);
159
Assert.Equal("Hello from Alice!", response.Messages[0].
Text
);
163
Assert.Equal("Hi from Bob!", response.Messages[1].
Text
);
167
Assert.Equal("Greetings from Charlie!", response.Messages[2].
Text
);
171
Assert.Equal("Alice again! Still Alice. And more.", response.Messages[3].
Text
);
209
Assert.Equal("AB", response.Messages[0].
Text
);
214
Assert.Equal("C", response.Messages[1].
Text
);
219
Assert.Equal("DE", response.Messages[2].
Text
);
224
Assert.Equal("F", response.Messages[3].
Text
);
229
Assert.Equal("GH", response.Messages[4].
Text
);
265
Assert.Equal("Hello world! How are you?", message.
Text
);
296
Assert.Equal("Hello there I'm Bob speaking", response.Messages[0].
Text
);
300
Assert.Equal("Now Alice", response.Messages[1].
Text
);
331
Assert.Equal("Hello there from AI", response.Messages[0].
Text
);
335
Assert.Equal("Next message", response.Messages[1].
Text
);
368
Assert.Equal("Hello world! How are you?", message.
Text
);
399
Assert.Equal("Hello there from AI", response.Messages[0].
Text
);
403
Assert.Equal("User message", response.Messages[1].
Text
);
436
Assert.Equal("Hello from agent1", response.Messages[0].
Text
);
439
Assert.Equal("Hi from agent2", response.Messages[1].
Text
);
442
Assert.Equal("Assistant here", response.Messages[2].
Text
);
489
Assert.Equal("Hi! Hello from AI", message1.
Text
);
497
Assert.Equal("More text", message2.
Text
);
505
Assert.Equal("How are you?", message3.
Text
);
513
Assert.Equal("I'm doing well, thank you! How can I help?", message4.
Text
);
773
Assert.Equal("abcdefg", response.Messages[0].
Text
);
820
Assert.Equal("ab", response.Messages[0].
Text
);
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
432
yield return new ChatRequestSystemMessage(input.
Text
?? string.Empty);
436
yield return new ChatRequestDeveloperMessage(input.
Text
?? string.Empty);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
27
Assert.Equal(expectedMessage.
Text
, chatMessage.
Text
);
Microsoft.Extensions.AI.Evaluation (3)
ChatMessageExtensions.cs (3)
99
/// This function only considers the <see cref="ChatMessage.
Text
"/> and ignores any <see cref="AIContent"/>s
124
string? content = message.
Text
;
138
/// This function only considers the <see cref="ChatMessage.
Text
"/> and ignores any <see cref="AIContent"/>s
Microsoft.Extensions.AI.Evaluation.Quality (3)
RelevanceEvaluator.cs (1)
79
if (!messages.TryGetUserRequest(out ChatMessage? userRequest) || string.IsNullOrWhiteSpace(userRequest.
Text
))
RelevanceTruthAndCompletenessEvaluator.cs (1)
100
string.IsNullOrWhiteSpace(userRequest.
Text
))
RetrievalEvaluator.cs (1)
84
if (!messages.TryGetUserRequest(out ChatMessage? userRequest) || string.IsNullOrWhiteSpace(userRequest.
Text
))
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (4)
ScenarioRunResultTests.cs (3)
298
=> x?.AuthorName == y?.AuthorName && x?.Role == y?.Role && x?.
Text
== y?.
Text
;
301
=> obj.
Text
.GetHashCode();
SerializationChainingTests.cs (1)
51
Assert.Equal("A user message", resp.ModelResponse.Messages[0].
Text
);
Microsoft.Extensions.AI.Evaluation.Safety (6)
ContentSafetyChatClient.cs (2)
58
string payload = messages.Single().
Text
;
91
string payload = messages.Single().
Text
;
ContentSafetyServicePayloadUtilities.cs (4)
112
item.Add(new XElement(questionElementName, question.
Text
));
117
item.Add(new XElement(answerElementName, answer.
Text
));
204
item[questionPropertyName] = question.
Text
;
209
item[answerPropertyName] = answer.
Text
;
Microsoft.Extensions.AI.Integration.Tests (22)
ChatClientIntegrationTests.cs (18)
181
Assert.Equal(history[1].
Text
, singleTextContent.Text);
672
Assert.Equal(firstResponse.Messages.Select(m => m.
Text
), secondResponse.Messages.Select(m => m.
Text
));
1165
Assert.Contains("Alice", m.
Text
);
1167
m => Assert.StartsWith("The Sierra Nevada section", m.
Text
, StringComparison.Ordinal),
1168
m => Assert.StartsWith("What's my name", m.
Text
, StringComparison.Ordinal));
1207
Assert.Equal("You are a pirate. Always respond in pirate speak.", m.
Text
);
1210
m => Assert.StartsWith("Aye, ye best be bringin'", m.
Text
, StringComparison.Ordinal),
1211
m => Assert.Equal("What's 2 + 2?", m.
Text
));
1305
Assert.Contains("Bob", m.
Text
);
1307
m => Assert.StartsWith("Personalized learning", m.
Text
, StringComparison.Ordinal),
1308
m => Assert.Equal("Was anyone named in the conversation? Provide their name and job.", m.
Text
));
1348
summaryMessage.
Text
.IndexOf("3", StringComparison.Ordinal) >= 0 ||
1349
summaryMessage.
Text
.IndexOf("5", StringComparison.Ordinal) >= 0 ||
1350
summaryMessage.
Text
.IndexOf("200", StringComparison.Ordinal) >= 0 ||
1351
summaryMessage.
Text
.IndexOf("10", StringComparison.Ordinal) >= 0,
1352
$"Expected numbers in summary: {summaryMessage.
Text
}");
1668
var conversationText = string.Join("\n", messages.Select(m => $"{m.Role}: {m.
Text
}"));
ReducingChatClientTests.cs (2)
33
m => Assert.StartsWith("Golden retrievers are quite active", m.
Text
, StringComparison.Ordinal),
34
m => Assert.StartsWith("Are they good with kids?", m.
Text
, StringComparison.Ordinal));
ToolReductionTests.cs (2)
232
strategy.MessagesEmbeddingTextSelector = msgs => new ValueTask<string>(msgs.LastOrDefault()?.
Text
?? string.Empty);
254
return new ValueTask<string>(string.Join("\n", msgs.Select(m => m.
Text
)));
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
653
string text = input.
Text
;
Microsoft.Extensions.AI.OpenAI.Tests (13)
OpenAIAssistantChatClientIntegrationTests.cs (1)
62
Assert.NotEmpty(message.
Text
);
OpenAIConversionTests.cs (4)
429
Assert.Equal("You are a helpful assistant.", convertedMessages[0].
Text
);
430
Assert.Equal("Hello", convertedMessages[1].
Text
);
431
Assert.Equal("Hi there!", convertedMessages[2].
Text
);
457
Assert.Equal("Hi there!", message.
Text
);
OpenAIResponseClientIntegrationTests.cs (1)
38
Assert.Equal("6", message.
Text
);
OpenAIResponseClientTests.cs (5)
819
Assert.Equal("Hello!", response.Messages[0].
Text
);
821
Assert.Equal(" How can I assist you today?", response.Messages[1].
Text
);
1075
Assert.Equal("The `README.md` file for `Microsoft.Extensions.AI.Abstractions` is located at:\n\n```\nsrc/Libraries/Microsoft.Extensions.AI.Abstractions/README.md\n```\n\nThis file provides an overview of the `Microsoft.Extensions.AI.Abstractions` package, including installation instructions and usage examples for its core interfaces like `IChatClient` and `IEmbeddingGenerator`.", response.Messages[0].
Text
);
1331
Assert.Equal("The `README.md` file for `Microsoft.Extensions.AI.Abstractions` is located at:\n\n```\nsrc/Libraries/Microsoft.Extensions.AI.Abstractions/README.md\n```\n\nThis file includes an overview, installation instructions, and usage examples related to the package.", response.Messages[0].
Text
);
1745
Assert.StartsWith("The path to the `README.md` file", response.Messages[0].
Text
);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
27
Assert.Equal(expectedMessage.
Text
, chatMessage.
Text
);
Microsoft.Extensions.AI.Tests (53)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (9)
69
message => Assert.Equal("Hello", message.
Text
));
93
Assert.Equal("Hello", Assert.Single(chatHistory).
Text
);
120
message => Assert.Equal("Hello", message.
Text
),
124
Assert.Contains("Respond with a JSON value", message.
Text
);
125
Assert.Contains("https://json-schema.org/draft/2020-12/schema", message.
Text
);
128
Assert.Contains(v.ToString(), message.
Text
); // All enum values are described as strings
154
Assert.Equal("Hello", Assert.Single(chatHistory).
Text
);
324
Assert.Equal("Hello", Assert.Single(chatHistory).
Text
);
352
Assert.Equal("Hello", Assert.Single(chatHistory).
Text
);
ChatCompletion\DistributedCachingChatClientTest.cs (2)
809
Assert.Equal(expectedMessage.
Text
, actualMessage.
Text
);
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
756
if (chatContents.Last().
Text
== "Hello")
ChatReduction\MessageCountingChatReducerTests.cs (12)
67
Assert.Equal("You are a helpful assistant.", m.
Text
);
72
Assert.Equal("How are you?", m.
Text
);
77
Assert.Equal("I'm doing well, thanks!", m.
Text
);
103
Assert.Equal("First system message", m.
Text
);
108
Assert.Equal("How are you?", m.
Text
);
113
Assert.Equal("I'm fine!", m.
Text
);
142
Assert.Equal("Thanks!", m.
Text
);
149
Assert.Equal("You're welcome!", m.
Text
);
187
Assert.Equal($"Message {expectedIndex}", m.
Text
);
212
Assert.Equal("System prompt", m.
Text
);
255
Assert.Equal("System", m.
Text
);
260
Assert.Equal("Fourth", m.
Text
);
ChatReduction\SummarizingChatReducerTests.cs (27)
83
Assert.Equal("You are a helpful assistant.", resultList[0].
Text
);
119
m => Assert.Contains("Asked about time", m.
Text
),
127
m => Assert.Contains("sunny", m.
Text
));
166
Assert.Contains("Summary", resultList[0].
Text
);
170
m => Assert.Contains("Second question", m.
Text
),
171
m => Assert.Contains("Second answer", m.
Text
),
172
m => Assert.Contains("Third question", m.
Text
),
173
m => Assert.Contains("Third answer", m.
Text
));
204
Assert.Contains(msgList, m => m.
Text
.Contains("What's the weather in Seattle?"));
205
Assert.Contains(msgList, m => m.
Text
.Contains("sunny and 72°F in Seattle"));
206
Assert.Contains(msgList, m => m.
Text
.Contains("What about New York?"));
218
Assert.Contains("User asked about weather", resultList[0].
Text
);
225
Assert.DoesNotContain(resultList, m => m.
Text
.Contains("sunny and 72°F in Seattle"));
260
Assert.StartsWith("Summary", resultList[0].
Text
, StringComparison.Ordinal);
316
Assert.Equal("First system message", resultList[0].
Text
);
341
m => Assert.StartsWith("Hi there!", m.
Text
, StringComparison.Ordinal),
342
m => Assert.StartsWith("Of course!", m.
Text
, StringComparison.Ordinal),
343
m => Assert.StartsWith("What kind of exercise", m.
Text
, StringComparison.Ordinal),
357
m => Assert.StartsWith("The user asked for information", m.
Text
, StringComparison.Ordinal),
358
m => Assert.StartsWith("Golden retrievers are quite", m.
Text
, StringComparison.Ordinal),
359
m => Assert.StartsWith("Are they good with kids", m.
Text
, StringComparison.Ordinal));
368
m => Assert.StartsWith("The user asked", m.
Text
, StringComparison.Ordinal),
369
m => Assert.StartsWith("Golden retrievers are quite active", m.
Text
, StringComparison.Ordinal),
370
m => Assert.StartsWith("Are they good with kids", m.
Text
, StringComparison.Ordinal),
383
m => Assert.StartsWith("The user and assistant are discussing", m.
Text
, StringComparison.Ordinal),
384
m => Assert.StartsWith("Golden retrievers get along", m.
Text
, StringComparison.Ordinal),
385
m => Assert.StartsWith("Do they make good lap dogs", m.
Text
, StringComparison.Ordinal));
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
27
Assert.Equal(expectedMessage.
Text
, chatMessage.
Text
);
Microsoft.ML.GenAI.LLaMA (2)
Llama3_1ChatTemplateBuilder.cs (2)
94
if (messages.Any(m => m.
Text
is null))
109
var content = message.
Text
!;
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3ChatTemplateBuilder.cs (2)
95
if (messages.Any(m => m.
Text
is null))
112
var content = message.
Text
;
OpenAIEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
121
__builder.AddContent(5, message.
Text