27 instantiations of TextReasoningContent
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseExtensions.cs (1)
243TextReasoningContent content = new(MergeText(contents, start, end))
Microsoft.Extensions.AI.Abstractions.Tests (20)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (16)
607new() { Contents = [new TextReasoningContent("D")] }, 608new() { Contents = [new TextReasoningContent("E")] }, 609new() { Contents = [new TextReasoningContent("F")] }, 612new() { Contents = [new TextReasoningContent("I")] }, 613new() { Contents = [new TextReasoningContent("J")] }, 615new() { Contents = [new TextReasoningContent("L")] }, 618new() { Contents = [new TextReasoningContent("O")] }, 619new() { Contents = [new TextReasoningContent("P")] }, 642new() { Contents = [new TextReasoningContent("A") { ProtectedData = "1" }] }, 643new() { Contents = [new TextReasoningContent("B") { ProtectedData = "2" }] }, 644new() { Contents = [new TextReasoningContent("C")] }, 645new() { Contents = [new TextReasoningContent("D")] }, 646new() { Contents = [new TextReasoningContent("E") { ProtectedData = "3" }] }, 647new() { Contents = [new TextReasoningContent("F") { ProtectedData = "4" }] }, 648new() { Contents = [new TextReasoningContent("G")] }, 649new() { Contents = [new TextReasoningContent("H")] },
Contents\AIContentTests.cs (1)
64new TextReasoningContent("reasoning text"),
Contents\TextReasoningContentTests.cs (3)
17TextReasoningContent c = new(text); 27TextReasoningContent c = new(null); 62var content = new TextReasoningContent("reasoning text") { ProtectedData = "protected" };
Microsoft.Extensions.AI.Integration.Tests (1)
ToolReductionTests.cs (1)
280new TextReasoningContent(reasoningLine),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIResponsesChatClient.cs (2)
199message.Contents.Add(new TextReasoningContent(reasoningItem.GetSummaryText()) 459yield return CreateUpdate(new TextReasoningContent(delta));
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\OpenTelemetryChatClientTests.cs (3)
356new TextReasoningContent("This is reasoning"), 372yield return new() { Contents = [new TextReasoningContent("This is reasoning")] }; 394new TextReasoningContent("User reasoning"),
33 references to TextReasoningContent
Microsoft.Extensions.AI (2)
ChatCompletion\OpenTelemetryChatClient.cs (1)
253case TextReasoningContent trc when !string.IsNullOrWhiteSpace(trc.Text):
ToolReduction\EmbeddingToolReductionStrategy.cs (1)
63case TextReasoningContent content:
Microsoft.Extensions.AI.Abstractions (9)
ChatCompletion\ChatResponseExtensions.cs (4)
237Coalesce<TextReasoningContent>( 243TextReasoningContent content = new(MergeText(contents, start, end)) 251Debug.Assert(contents[i] is TextReasoningContent { ProtectedData: null }, "Expected all but the last to have a null ProtectedData"); 255if (((TextReasoningContent)contents[end - 1]).ProtectedData is { } protectedData)
Contents\AIContent.cs (1)
18[JsonDerivedType(typeof(TextReasoningContent), typeDiscriminator: "reasoning")]
Contents\TextReasoningContent.cs (4)
13/// <see cref="TextReasoningContent"/> is distinct from <see cref="TextContent"/>. <see cref="TextReasoningContent"/> 21/// Initializes a new instance of the <see cref="TextReasoningContent"/> class. 44/// sent back to the provider and not displayed to the user. It's possible for a <see cref="TextReasoningContent"/> to contain
Microsoft.Extensions.AI.Abstractions.Tests (19)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (14)
626Assert.Equal("DEF", Assert.IsType<TextReasoningContent>(message.Contents[1]).Text); 628Assert.Equal("IJ", Assert.IsType<TextReasoningContent>(message.Contents[3]).Text); 630Assert.Equal("L", Assert.IsType<TextReasoningContent>(message.Contents[5]).Text); 632Assert.Equal("OP", Assert.IsType<TextReasoningContent>(message.Contents[7]).Text); 656Assert.Equal("A", Assert.IsType<TextReasoningContent>(message.Contents[0]).Text); 657Assert.Equal("1", ((TextReasoningContent)message.Contents[0]).ProtectedData); 659Assert.Equal("B", Assert.IsType<TextReasoningContent>(message.Contents[1]).Text); 660Assert.Equal("2", ((TextReasoningContent)message.Contents[1]).ProtectedData); 662Assert.Equal("CDE", Assert.IsType<TextReasoningContent>(message.Contents[2]).Text); 663Assert.Equal("3", ((TextReasoningContent)message.Contents[2]).ProtectedData); 665Assert.Equal("F", Assert.IsType<TextReasoningContent>(message.Contents[3]).Text); 666Assert.Equal("4", ((TextReasoningContent)message.Contents[3]).ProtectedData); 668Assert.Equal("GH", Assert.IsType<TextReasoningContent>(message.Contents[4]).Text); 669Assert.Null(((TextReasoningContent)message.Contents[4]).ProtectedData);
Contents\TextReasoningContentTests.cs (5)
17TextReasoningContent c = new(text); 27TextReasoningContent c = new(null); 62var content = new TextReasoningContent("reasoning text") { ProtectedData = "protected" }; 65var deserializedContent = JsonSerializer.Deserialize<TextReasoningContent>(json, AIJsonUtilities.DefaultOptions);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
1042case TextReasoningContent reasoningContent:
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIResponseClientTests.cs (2)
330var reasoning = Assert.IsType<TextReasoningContent>(updates[i].Contents.Single());