138 instantiations of TextContent
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (7)
Microsoft.Extensions.AI.Abstractions.Tests (42)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (10)
681new() { Contents = [new TextContent("D") { Annotations = [new()] }] },
682new() { Contents = [new TextContent("E") { Annotations = [new()] }] },
683new() { Contents = [new TextContent("F") { Annotations = [new()] }] },
684new() { Contents = [new TextContent("G") { Annotations = [] }] },
685new() { Contents = [new TextContent("H") { Annotations = [] }] },
686new() { Contents = [new TextContent("I") { Annotations = [new()] }] },
687new() { Contents = [new TextContent("J") { Annotations = [new()] }] },
689new() { Contents = [new TextContent("L") { Annotations = [new()] }] },
692new() { Contents = [new TextContent("O") { Annotations = [new()] }] },
693new() { Contents = [new TextContent("P") { Annotations = [new()] }] },
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.AI.AzureAIInference.Tests (3)
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 (4)
Microsoft.Extensions.AI.OpenAI (9)
Microsoft.Extensions.AI.OpenAI.Tests (17)
OpenAIConversionTests.cs (12)
165new TextContent("Hi there!"),
234new TextContent("Hi there!"),
285new TextContent("Hello, "),
288new TextContent("World"),
289new TextContent("!"),
293new TextContent("Hi!"),
474new TextContent("I'll call a function."),
510new TextContent("Here's an image and some text."),
579new TextContent("I'll process this complex data."),
834new TextContent("Processing your request..."),
1076new TextContent("Third message with function call"),
1111new TextContent("I'll call a function"),
Microsoft.Extensions.AI.Tests (34)
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
552new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]),
556new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]),
766updates = [new() { Contents = [new TextContent("OK bye")] }];
930? [new TextContent($"The search results were '{string.Join(", ", frcs.Select(frc => frc.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")]),
151 references to TextContent
Aspire.Dashboard (3)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (23)
Microsoft.Extensions.AI.Abstractions.Tests (53)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (19)
588TextContent[] contents = message.Contents.OfType<TextContent>().ToArray();
624Assert.Equal("ABC", Assert.IsType<TextContent>(message.Contents[0]).Text);
626Assert.Equal("GH", Assert.IsType<TextContent>(message.Contents[2]).Text);
628Assert.Equal("K", Assert.IsType<TextContent>(message.Contents[4]).Text);
630Assert.Equal("MN", Assert.IsType<TextContent>(message.Contents[6]).Text);
699Assert.Equal("ABC", Assert.IsType<TextContent>(message.Contents[0]).Text);
700Assert.Equal("D", Assert.IsType<TextContent>(message.Contents[1]).Text);
701Assert.Equal("E", Assert.IsType<TextContent>(message.Contents[2]).Text);
702Assert.Equal("F", Assert.IsType<TextContent>(message.Contents[3]).Text);
703Assert.Equal("GH", Assert.IsType<TextContent>(message.Contents[4]).Text);
704Assert.Equal("I", Assert.IsType<TextContent>(message.Contents[5]).Text);
705Assert.Equal("J", Assert.IsType<TextContent>(message.Contents[6]).Text);
706Assert.Equal("K", Assert.IsType<TextContent>(message.Contents[7]).Text);
707Assert.Equal("L", Assert.IsType<TextContent>(message.Contents[8]).Text);
708Assert.Equal("MN", Assert.IsType<TextContent>(message.Contents[9]).Text);
709Assert.Equal("O", Assert.IsType<TextContent>(message.Contents[10]).Text);
710Assert.Equal("P", Assert.IsType<TextContent>(message.Contents[11]).Text);
730Assert.Equal("Hello, world!", Assert.IsType<TextContent>(Assert.Single(Assert.Single(response.Messages).Contents)).Text);
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.AI.Evaluation (11)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (8)
Microsoft.Extensions.AI.Evaluation.Safety (6)
Microsoft.Extensions.AI.Integration.Tests (5)
Microsoft.Extensions.AI.OpenAI (11)
Microsoft.Extensions.AI.OpenAI.Tests (15)
Microsoft.Extensions.AI.Tests (11)