12 writes to ProtectedData
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseExtensions.cs (1)
257content.ProtectedData = protectedData;
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (4)
727new() { Contents = [new TextReasoningContent("A") { ProtectedData = "1" }] }, 728new() { Contents = [new TextReasoningContent("B") { ProtectedData = "2" }] }, 731new() { Contents = [new TextReasoningContent("E") { ProtectedData = "3" }] }, 732new() { Contents = [new TextReasoningContent("F") { ProtectedData = "4" }] },
Contents\TextReasoningContentTests.cs (3)
53c.ProtectedData = "protected"; 55c.ProtectedData = null; 62var content = new TextReasoningContent("reasoning text") { ProtectedData = "protected" };
Microsoft.Extensions.AI.OpenAI (2)
OpenAIResponsesChatClient.cs (2)
193ProtectedData = reasoningItem.EncryptedContent, 483yield return CreateUpdate(new TextReasoningContent(null) { ProtectedData = encryptedContent });
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIResponseClientIntegrationTests.cs (2)
628reasoning.ProtectedData = "completely_invalid_encrypted_content_that_should_fail"; 708reasoning.ProtectedData = "completely_invalid_encrypted_content_that_should_fail";
30 references to ProtectedData
Microsoft.Extensions.AI.Abstractions (5)
ChatCompletion\ChatResponseExtensions.cs (3)
240canMerge: static (r1, r2) => string.IsNullOrEmpty(r1.ProtectedData), // we allow merging if the first item has no ProtectedData, even if the second does 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\TextReasoningContent.cs (2)
45/// only <see cref="ProtectedData"/> and have an empty <see cref="Text"/> property. This data also may be associated with 49/// Note that whereas <see cref="Text"/> can be provider agnostic, <see cref="ProtectedData"/>
Microsoft.Extensions.AI.Abstractions.Tests (10)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (5)
742Assert.Equal("1", ((TextReasoningContent)message.Contents[0]).ProtectedData); 745Assert.Equal("2", ((TextReasoningContent)message.Contents[1]).ProtectedData); 748Assert.Equal("3", ((TextReasoningContent)message.Contents[2]).ProtectedData); 751Assert.Equal("4", ((TextReasoningContent)message.Contents[3]).ProtectedData); 754Assert.Null(((TextReasoningContent)message.Contents[4]).ProtectedData);
Contents\TextReasoningContentTests.cs (5)
20Assert.Null(c.ProtectedData); 52Assert.Null(c.ProtectedData); 54Assert.Equal("protected", c.ProtectedData); 56Assert.Null(c.ProtectedData); 69Assert.Equal("protected", deserializedContent.ProtectedData);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
1145EncryptedContent = reasoningContent.ProtectedData,
Microsoft.Extensions.AI.OpenAI.Tests (14)
OpenAIResponseClientIntegrationTests.cs (12)
591Assert.NotNull(reasoningContent.ProtectedData); 592Assert.NotEmpty(reasoningContent.ProtectedData); 611.First(r => !string.IsNullOrEmpty(r.ProtectedData)); 614Assert.Equal(reasoningContent.ProtectedData, deserializedReasoning.ProtectedData); 626.Where(r => !string.IsNullOrEmpty(r.ProtectedData))) 672Assert.NotNull(reasoningContent.ProtectedData); 673Assert.NotEmpty(reasoningContent.ProtectedData); 691.First(r => !string.IsNullOrEmpty(r.ProtectedData)); 694Assert.Equal(reasoningContent.ProtectedData, deserializedReasoning.ProtectedData); 706.Where(r => !string.IsNullOrEmpty(r.ProtectedData)))
OpenAIResponseClientTests.cs (2)
571Assert.Contains(reasoningContents, r => r.ProtectedData == "secret-encrypted-data-abc123"); 578Assert.Equal("secret-encrypted-data-abc123", coalescedReasoning.ProtectedData);