5 writes to Text
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatMessage.cs (1)
67textContent.Text = value;
ChatCompletion\StreamingChatCompletionUpdate.cs (1)
73textContent.Text = value;
Microsoft.Extensions.AI.Abstractions.Tests (3)
Contents\TextContentTests.cs (3)
38c.Text = "text"; 42c.Text = null; 46c.Text = string.Empty;
31 references to Text
Microsoft.Extensions.AI (1)
ChatCompletion\ChatCompletion{T}.cs (1)
121return (content as TextContent)?.Text;
Microsoft.Extensions.AI.Abstractions (8)
ChatCompletion\ChatMessage.cs (1)
62get => Contents.FindFirst<TextContent>()?.Text;
ChatCompletion\StreamingChatCompletionUpdate.cs (1)
68get => Contents.FindFirst<TextContent>()?.Text;
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (3)
207_ = coalescedText.Clear().Append(firstText.Text).Append(secondText.Text); 212_ = coalescedText.Append(next.Text);
Contents\AIContentExtensions.cs (2)
43return contents[0] is TextContent tc ? tc.Text : string.Empty; 52builder.AppendLiteral(text.Text);
Contents\TextContent.cs (1)
35public override string ToString() => Text;
Microsoft.Extensions.AI.Abstractions.Tests (19)
ChatCompletion\ChatCompletionTests.cs (2)
277Assert.Equal("Hello, ", Assert.IsType<TextContent>(update0.Contents[0]).Text); 279Assert.Equal("world!", Assert.IsType<TextContent>(update0.Contents[2]).Text);
ChatCompletion\ChatMessageTests.cs (6)
48Assert.Equal(text, tc.Text); 91Assert.Equal($"text-{i}", tc.Text); 136Assert.Equal("text-1", textContent.Text); 158Assert.Equal("text-1", textContent.Text); 314Assert.Equal("content-1-override", textContent.Text); 353Assert.Equal("content-6", textContent.Text);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (2)
188Assert.Equal(expected[i], contents[i].Text); 209Assert.Equal("Hello, world!", Assert.IsType<TextContent>(Assert.Single(completion.Message.Contents)).Text);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (4)
104Assert.Equal("text-1", textContent.Text); 129Assert.Equal("text-1", textContent.Text); 193Assert.Equal("text-1", ((TextContent)result.Contents[0]).Text); 205Assert.Equal("text-2", ((TextContent)result.Contents[4]).Text);
Contents\TextContentTests.cs (5)
19Assert.Equal(text ?? string.Empty, c.Text); 37Assert.Equal(string.Empty, c.Text); 39Assert.Equal("text", c.Text); 43Assert.Equal(string.Empty, c.Text); 47Assert.Equal(string.Empty, c.Text);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
478parts.Add(new ChatMessageTextContentItem(textContent.Text));
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
368Content = textContent.Text ?? string.Empty,
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
654parts.Add(ChatMessageContentPart.CreateTextPart(textContent.Text));