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;
42 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)
223_ = coalescedText.Clear().Append(firstText.Text).Append(secondText.Text); 228_ = 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)
484parts.Add(new ChatMessageTextContentItem(textContent.Text));
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
389Content = textContent.Text ?? string.Empty,
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatMessage.cs (1)
220parts.Add(ChatMessageContentPart.CreateTextPart(textContent.Text));
Microsoft.Extensions.AI.OpenAI.Tests (9)
OpenAISerializationTests.cs (9)
50Assert.Equal("hello", textContent.Text); 83Assert.Equal("hello", textContent.Text); 158Assert.Equal("You are a really nice friend.", text.Text); 170Assert.Equal("hello!", text.Text); 182Assert.Equal("hi, how are you?", text.Text); 194Assert.Equal("i'm good. how are you?", text.Text); 255Assert.Equal("You are a really nice friend.", text.Text); 263Assert.Equal("Really nice.", text.Text); 276Assert.Equal("hello!", text.Text);
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
542m => Assert.Equal("Hello", Assert.IsType<TextContent>(Assert.Single(m.Contents)).Text), 553Assert.Equal("OK bye", singleUpdateContent.Text);