40 references to TextContent
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatResponseExtensions.cs (1)
291contents[start] = new TextContent(coalescedText.ToString())
ChatCompletion\ChatResponseUpdate.cs (1)
51: this(role, content is null ? null : [new TextContent(content)])
Microsoft.Extensions.AI.Abstractions.Tests (13)
ChatCompletion\ChatMessageTests.cs (5)
89content.Add(new TextContent($"text-{i}")); 147new TextContent("text-1"), 148new TextContent("text-2"), 239new TextContent("content-1") 251new TextContent("content-4")
ChatCompletion\ChatResponseUpdateTests.cs (6)
43update.Contents.Add(new TextContent("text")); 47IList<AIContent> newList = [new TextContent("text")]; 90new TextContent("text-1"), 91new TextContent("text-2"), 116new TextContent("text-1"), 120new TextContent("text-2"),
Contents\TextContentTests.cs (2)
16TextContent c = new(text); 25TextContent c = new(null);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
178responseUpdate.Contents.Add(new TextContent(update));
Microsoft.Extensions.AI.AzureAIInference.Tests (3)
AzureAIInferenceChatClientTests.cs (3)
156[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 228[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 617new TextContent("Describe this picture."),
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
SerializationChainingTests.cs (1)
34new TextContent("A user message"),
Microsoft.Extensions.AI.Integration.Tests (3)
ChatClientIntegrationTests.cs (1)
177new TextContent("What does this logo say?"),
PromptBasedFunctionCallingChatClient.cs (2)
73message.Contents[itemIndex] = new TextContent( 80message.Contents[itemIndex] = new TextContent(
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
271contents.Insert(0, new TextContent(message.Content));
Microsoft.Extensions.AI.OpenAI (2)
OpenAIModelMapper.ChatCompletion.cs (1)
565aiContent = new TextContent(contentPart.Text);
OpenAIModelMapper.ChatMessage.cs (1)
204contents.Add(new TextContent(openAiContentPart.Text));
Microsoft.Extensions.AI.OpenAI.Tests (5)
OpenAIChatClientTests.cs (3)
550new(ChatRole.System, [new TextContent("You are a really nice friend."), new TextContent("Really nice.")]), 1018new TextContent("hi, how are you?"),
OpenAISerializationTests.cs (2)
469new TextContent("Hello! How can I assist you today?"), 568List<AIContent> contents = [new TextContent($"Streaming update {i}")];
Microsoft.Extensions.AI.Tests (9)
ChatCompletion\DistributedCachingChatClientTest.cs (5)
338new() { Role = ChatRole.Assistant, Contents = [new TextContent("Hello")] }, 339new() { Role = ChatRole.Assistant, Contents = [new TextContent(" world, ")] }, 345new TextContent("how ") 356new TextContent("are you?") 666new ChatMessage(ChatRole.Assistant, [new TextContent("Hey")])));
ChatCompletion\FunctionInvokingChatClientTests.cs (4)
219new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]), 223new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]), 415updates = [new() { Contents = [new TextContent("OK bye")] }];