172 instantiations of TextContent
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (7)
Microsoft.Extensions.AI.Abstractions.Tests (54)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (10)
767new() { Contents = [new TextContent("D") { Annotations = [new()] }] },
768new() { Contents = [new TextContent("E") { Annotations = [new()] }] },
769new() { Contents = [new TextContent("F") { Annotations = [new()] }] },
770new() { Contents = [new TextContent("G") { Annotations = [] }] },
771new() { Contents = [new TextContent("H") { Annotations = [] }] },
772new() { Contents = [new TextContent("I") { Annotations = [new()] }] },
773new() { Contents = [new TextContent("J") { Annotations = [new()] }] },
775new() { Contents = [new TextContent("L") { Annotations = [new()] }] },
778new() { Contents = [new TextContent("O") { Annotations = [new()] }] },
779new() { Contents = [new TextContent("P") { Annotations = [new()] }] },
Microsoft.Extensions.AI.Evaluation (1)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (6)
Microsoft.Extensions.AI.Evaluation.NLP (2)
Microsoft.Extensions.AI.Evaluation.Quality (4)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (7)
Microsoft.Extensions.AI.Integration.Tests (6)
Microsoft.Extensions.AI.OpenAI (11)
Microsoft.Extensions.AI.OpenAI.Tests (28)
OpenAIConversionTests.cs (12)
645new TextContent("Hi there!"),
714new TextContent("Hi there!"),
765new TextContent("Hello, "),
768new TextContent("World"),
769new TextContent("!"),
773new TextContent("Hi!"),
954new TextContent("I'll call a function."),
990new TextContent("Here's an image and some text."),
1059new TextContent("I'll process this complex data."),
1314new TextContent("Processing your request..."),
1556new TextContent("Third message with function call"),
1591new TextContent("I'll call a function"),
Microsoft.Extensions.AI.Tests (43)
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
984new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]),
988new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]),
1198updates = [new() { Contents = [new TextContent("OK bye")] }];
1362? [new TextContent($"The search results were '{string.Join(", ", frcs.Select(frc => frc.Result))}'")]
ChatCompletion\OpenTelemetryChatClientTests.cs (11)
406new TextContent("Assistant response text"),
444new TextContent("User request text"),
605new TextContent("Hello!"),
607new TextContent("How are you?"),
660new TextContent("Processing with tools..."),
661new CodeInterpreterToolCallContent { CallId = "ci-call-1", Inputs = [new TextContent("print('hello')")] },
662new CodeInterpreterToolResultContent { CallId = "ci-call-1", Outputs = [new TextContent("hello")] },
666new McpServerToolResultContent("mcp-call-1") { Output = [new TextContent("Tool result")] },
677yield return new() { Contents = [new CodeInterpreterToolCallContent { CallId = "ci-call-1", Inputs = [new TextContent("print('hello')")] }] };
678yield return new() { Contents = [new CodeInterpreterToolResultContent { CallId = "ci-call-1", Outputs = [new TextContent("hello")] }] };
682yield return new() { Contents = [new McpServerToolResultContent("mcp-call-1") { Output = [new TextContent("Tool result")] }] };
Functions\AIFunctionFactoryTest.cs (18)
932AIFunctionFactory.Create(() => (AIContent)new TextContent("text")),
933AIFunctionFactory.Create(async () => (AIContent)new TextContent("text")),
934AIFunctionFactory.Create(async ValueTask<AIContent> () => (AIContent)new TextContent("text")),
935AIFunctionFactory.Create(() => new TextContent("text")),
936AIFunctionFactory.Create(async () => new TextContent("text")),
937AIFunctionFactory.Create(async ValueTask<AIContent> () => new TextContent("text")),
949AIFunctionFactory.Create(() => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
950AIFunctionFactory.Create(async () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
951AIFunctionFactory.Create(async ValueTask<IEnumerable<AIContent>> () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
956AIFunctionFactory.Create(() => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
957AIFunctionFactory.Create(async () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
958AIFunctionFactory.Create(async ValueTask<AIContent[]> () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
963AIFunctionFactory.Create(() => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
964AIFunctionFactory.Create(async () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
965AIFunctionFactory.Create(async ValueTask<List<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
970AIFunctionFactory.Create(() => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
971AIFunctionFactory.Create(async () => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
972AIFunctionFactory.Create(async ValueTask<IList<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
Microsoft.Extensions.DataIngestion (1)
174 references to TextContent
Aspire.Dashboard (3)
Microsoft.Extensions.AI (3)
Microsoft.Extensions.AI.Abstractions (24)
Microsoft.Extensions.AI.Abstractions.Tests (63)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (20)
674TextContent[] contents = message.Contents.OfType<TextContent>().ToArray();
710Assert.Equal("ABC", Assert.IsType<TextContent>(message.Contents[0]).Text);
712Assert.Equal("GH", Assert.IsType<TextContent>(message.Contents[2]).Text);
714Assert.Equal("K", Assert.IsType<TextContent>(message.Contents[4]).Text);
716Assert.Equal("MN", Assert.IsType<TextContent>(message.Contents[6]).Text);
785Assert.Equal("ABC", Assert.IsType<TextContent>(message.Contents[0]).Text);
786Assert.Equal("D", Assert.IsType<TextContent>(message.Contents[1]).Text);
787Assert.Equal("E", Assert.IsType<TextContent>(message.Contents[2]).Text);
788Assert.Equal("F", Assert.IsType<TextContent>(message.Contents[3]).Text);
789Assert.Equal("GH", Assert.IsType<TextContent>(message.Contents[4]).Text);
790Assert.Equal("I", Assert.IsType<TextContent>(message.Contents[5]).Text);
791Assert.Equal("J", Assert.IsType<TextContent>(message.Contents[6]).Text);
792Assert.Equal("K", Assert.IsType<TextContent>(message.Contents[7]).Text);
793Assert.Equal("L", Assert.IsType<TextContent>(message.Contents[8]).Text);
794Assert.Equal("MN", Assert.IsType<TextContent>(message.Contents[9]).Text);
795Assert.Equal("O", Assert.IsType<TextContent>(message.Contents[10]).Text);
796Assert.Equal("P", Assert.IsType<TextContent>(message.Contents[11]).Text);
816Assert.Equal("Hello, world!", Assert.IsType<TextContent>(Assert.Single(Assert.Single(response.Messages).Contents)).Text);
957Assert.IsType<TextContent>(message.Contents[0]).Text);
Microsoft.Extensions.AI.Evaluation (11)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (8)
Microsoft.Extensions.AI.Evaluation.Safety (6)
Microsoft.Extensions.AI.Integration.Tests (8)
Microsoft.Extensions.AI.OpenAI (12)
Microsoft.Extensions.AI.OpenAI.Tests (25)
Microsoft.Extensions.AI.Tests (11)