73 references to TextContent
Microsoft.Extensions.AI.Abstractions (5)
ChatCompletion\ChatMessage.cs (1)
31: this(role, content is null ? [] : [new TextContent(content)])
ChatCompletion\ChatResponseExtensions.cs (1)
186Coalesce<TextContent>(contents, static text => new(text));
ChatCompletion\ChatResponseUpdate.cs (1)
51: this(role, content is null ? null : [new TextContent(content)])
SpeechToText\SpeechToTextResponse.cs (1)
37: this(content is null ? [] : [new TextContent(content)])
SpeechToText\SpeechToTextResponseUpdate.cs (1)
54: this(content is null ? [] : [new TextContent(content)])
Microsoft.Extensions.AI.Abstractions.Tests (28)
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)
44update.Contents.Add(new TextContent("text")); 48IList<AIContent> newList = [new TextContent("text")]; 95new TextContent("text-1"), 96new TextContent("text-2"), 121new TextContent("text-1"), 125new TextContent("text-2"),
Contents\TextContentTests.cs (2)
16TextContent c = new(text); 25TextContent c = new(null);
SpeechToText\SpeechToTextClientExtensionsTests.cs (1)
65update.Contents.Add(new TextContent("world"));
SpeechToText\SpeechToTextResponseTests.cs (9)
75content.Add(new TextContent($"text-{i}")); 132List<AIContent> newContents = [new TextContent("text1"), new TextContent("text2")]; 144new TextContent("Text1"), 145new TextContent("Text2"), 146new TextContent("Text3"), 147new TextContent("Text4"), 196new TextContent("Hello, "), 198new TextContent("world!")
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (1)
52new([new TextContent("You?")]) { ModelId = "model123", StartTime = TimeSpan.FromSeconds(24), EndTime = TimeSpan.FromSeconds(25), AdditionalProperties = new() { ["c"] = "d" } },
SpeechToText\SpeechToTextResponseUpdateTests.cs (4)
42newList.Add(new TextContent("content1")); 66new TextContent("text-1"), 67new TextContent("text-2"), 94new TextContent("text-1"),
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
179responseUpdate.Contents.Add(new TextContent(update));
Microsoft.Extensions.AI.AzureAIInference.Tests (3)
AzureAIInferenceChatClientTests.cs (3)
145[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 218[new ChatMessage(ChatRole.User, "hello".Select(c => (AIContent)new TextContent(c.ToString())).ToList())] : 1069new TextContent("Describe this picture."),
Microsoft.Extensions.AI.Evaluation (1)
EvaluationContext.cs (1)
135: this(name, contents: new TextContent(content))
Microsoft.Extensions.AI.Evaluation.Integration.Tests (6)
SafetyEvaluatorTests.cs (6)
274new TextContent("What does this image depict?"), 312new TextContent("Here's an image pertaining to DotNet:"), 346new TextContent("What does this image depict?"), 359new TextContent("Here's an image pertaining to Microsoft Copilot:"), 395new TextContent("What does this image depict?"), 408new TextContent("Here's an image pertaining to Microsoft Copilot:"),
Microsoft.Extensions.AI.Evaluation.Quality (1)
RetrievalEvaluatorContext.cs (1)
47contents: [.. retrievedContextChunks.Select(c => new TextContent(c))])
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (7)
ScenarioRunResultTests.cs (6)
23var content1 = new TextContent("content1"); 24var content2 = new TextContent("content2"); 25var content3 = new TextContent("content3"); 114var content1 = new TextContent("content1"); 115var content2 = new TextContent("content2"); 116var content3 = new TextContent("content3");
SerializationChainingTests.cs (1)
34new TextContent("A user message"),
Microsoft.Extensions.AI.Integration.Tests (2)
ChatClientIntegrationTests.cs (2)
179new TextContent("What does this logo say?"), 197new TextContent("What text does this document contain?"),
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
279contents.Insert(0, new TextContent(message.Content));
Microsoft.Extensions.AI.OpenAI (4)
OpenAIChatClient.cs (1)
635aiContent = new TextContent(contentPart.Text);
OpenAIResponseChatClient.cs (1)
533results.Add(new TextContent(part.Text));
OpenAISpeechToTextClient.cs (2)
172response.Contents = [new TextContent(audioTranscription.Text)]; 213response.Contents = [new TextContent(audioTranslation.Text)];
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIChatClientTests.cs (4)
870new(ChatRole.System, [new TextContent("You are a really nice friend."), new TextContent("Really nice.")]), 1412new TextContent("hi, how are you?"), 1530new TextContent("What does this logo say?"),
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\DistributedCachingChatClientTest.cs (5)
344new() { Role = ChatRole.Assistant, Contents = [new TextContent("Hello")] }, 345new() { Role = ChatRole.Assistant, Contents = [new TextContent(" world, ")] }, 351new TextContent("how ") 362new TextContent("are you?") 674new ChatMessage(ChatRole.Assistant, [new TextContent("Hey")])));
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
407new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]), 411new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]), 603updates = [new() { Contents = [new TextContent("OK bye")] }]; 767? [new TextContent($"The search results were '{string.Join(", ", frcs.Select(frc => frc.Result))}'")]