172 references to 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)
358new TextContent("Assistant response text"),
396new TextContent("User request text"),
557new TextContent("Hello!"),
559new TextContent("How are you?"),
612new TextContent("Processing with tools..."),
613new CodeInterpreterToolCallContent { CallId = "ci-call-1", Inputs = [new TextContent("print('hello')")] },
614new CodeInterpreterToolResultContent { CallId = "ci-call-1", Outputs = [new TextContent("hello")] },
618new McpServerToolResultContent("mcp-call-1") { Output = [new TextContent("Tool result")] },
629yield return new() { Contents = [new CodeInterpreterToolCallContent { CallId = "ci-call-1", Inputs = [new TextContent("print('hello')")] }] };
630yield return new() { Contents = [new CodeInterpreterToolResultContent { CallId = "ci-call-1", Outputs = [new TextContent("hello")] }] };
634yield 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)