216 instantiations of TextContent
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (8)
Microsoft.Extensions.AI.Abstractions.Tests (70)
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 (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (7)
Microsoft.Extensions.AI.Integration.Tests (4)
Microsoft.Extensions.AI.OpenAI (15)
Microsoft.Extensions.AI.OpenAI.Tests (30)
OpenAIConversionTests.cs (13)
730new TextContent("Hi there!"),
799new TextContent("Hi there!"),
850new TextContent("Hello, "),
853new TextContent("World"),
854new TextContent("!"),
858new TextContent("Hi!"),
1219new TextContent("I'll call a function."),
1490var mcpToolResult = new McpServerToolResultContent("call_123") { Outputs = isError ? [new ErrorContent("error")] : [new TextContent("sunny")] };
1521new TextContent("Here's an image and some text."),
1590new TextContent("I'll process this complex data."),
1845new TextContent("Processing your request..."),
2086new TextContent("Third message with function call"),
2121new TextContent("I'll call a function"),
Microsoft.Extensions.AI.Stabilization.Tests (8)
Microsoft.Extensions.AI.Tests (56)
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))}'")]
Functions\AIFunctionFactoryTest.cs (18)
1162AIFunctionFactory.Create(() => (AIContent)new TextContent("text")),
1163AIFunctionFactory.Create(async () => (AIContent)new TextContent("text")),
1164AIFunctionFactory.Create(async ValueTask<AIContent> () => (AIContent)new TextContent("text")),
1165AIFunctionFactory.Create(() => new TextContent("text")),
1166AIFunctionFactory.Create(async () => new TextContent("text")),
1167AIFunctionFactory.Create(async ValueTask<AIContent> () => new TextContent("text")),
1179AIFunctionFactory.Create(() => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1180AIFunctionFactory.Create(async () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1181AIFunctionFactory.Create(async ValueTask<IEnumerable<AIContent>> () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1186AIFunctionFactory.Create(() => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1187AIFunctionFactory.Create(async () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1188AIFunctionFactory.Create(async ValueTask<AIContent[]> () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1193AIFunctionFactory.Create(() => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1194AIFunctionFactory.Create(async () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1195AIFunctionFactory.Create(async ValueTask<List<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1200AIFunctionFactory.Create(() => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1201AIFunctionFactory.Create(async () => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
1202AIFunctionFactory.Create(async ValueTask<IList<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]),
Microsoft.Extensions.DataIngestion (1)
306 references to TextContent
Aspire.Dashboard (3)
Microsoft.AspNetCore.Components.AI (2)
Microsoft.Extensions.AI (3)
Microsoft.Extensions.AI.Abstractions (39)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TextContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
24get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
58DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
60Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Abstractions.Tests (99)
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);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestJsonSerializerContext.TextContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
22get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
56DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
58Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation (11)
Microsoft.Extensions.AI.Evaluation.Reporting (15)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TextContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
24get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
58DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
60Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (15)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TextContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
24get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
58DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
60Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (8)
Microsoft.Extensions.AI.Evaluation.Safety (6)
Microsoft.Extensions.AI.Integration.Tests (8)
Microsoft.Extensions.AI.OpenAI (13)
Microsoft.Extensions.AI.OpenAI.Tests (32)
Microsoft.Extensions.AI.Stabilization.Tests (26)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.TextContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
22get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
56DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
58Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Tests (26)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestJsonSerializerContext.TextContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>? _TextContent;
19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> TextContent
22get => _TextContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.TextContent));
25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> Create_TextContent(global::System.Text.Json.JsonSerializerOptions options)
27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.TextContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.TextContent> jsonTypeInfo))
29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.TextContent>
35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.TextContent>(options, objectInfo);
56DeclaringType = typeof(global::Microsoft.Extensions.AI.TextContent),
58Getter = static obj => ((global::Microsoft.Extensions.AI.TextContent)obj).Text,
59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.TextContent)obj).Text = value!,
66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextContent).GetProperty("Text", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),