84 writes to RawRepresentation
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseExtensions.cs (1)
259
RawRepresentation
= existing.RawRepresentation ?? webSearchCall.RawRepresentation,
Microsoft.Extensions.AI.Abstractions.Tests (20)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (2)
1029
new() { Contents = [new WebSearchToolCallContent("ws1") { Queries = ["second query"],
RawRepresentation
= rawRepresentation, AdditionalProperties = additionalProps }] },
1110
RawRepresentation
= rawRepresentation,
Contents\AIContentTests.cs (2)
27
c.
RawRepresentation
= raw;
41
RawRepresentation
= new object(),
Contents\CodeInterpreterToolCallContentTests.cs (1)
36
c.
RawRepresentation
= raw;
Contents\CodeInterpreterToolResultContentTests.cs (1)
36
c.
RawRepresentation
= raw;
Contents\FunctionCallContentTests.cs (1)
56
c.
RawRepresentation
= raw;
Contents\FunctionResultContentTests.cs (1)
41
c.
RawRepresentation
= raw;
Contents\HostedFileContentTests.cs (1)
51
c.
RawRepresentation
= raw;
Contents\HostedVectorStoreContentTests.cs (1)
45
c.
RawRepresentation
= raw;
Contents\ImageGenerationToolCallContentTests.cs (1)
29
c.
RawRepresentation
= raw;
Contents\ImageGenerationToolResultContentTests.cs (1)
37
c.
RawRepresentation
= raw;
Contents\McpServerToolCallContentTests.cs (1)
34
c.
RawRepresentation
= raw;
Contents\McpServerToolResultContentTests.cs (1)
30
c.
RawRepresentation
= raw;
Contents\TextContentTests.cs (1)
30
c.
RawRepresentation
= raw;
Contents\TextReasoningContentTests.cs (1)
31
c.
RawRepresentation
= raw;
Contents\ToolCallContentTests.cs (1)
36
c.
RawRepresentation
= raw;
Contents\ToolResultContentTests.cs (1)
35
c.
RawRepresentation
= raw;
Contents\WebSearchToolCallContentTests.cs (1)
35
c.
RawRepresentation
= raw;
Contents\WebSearchToolResultContentTests.cs (1)
40
c.
RawRepresentation
= raw;
Microsoft.Extensions.AI.OpenAI (50)
MicrosoftExtensionsAIChatExtensions.cs (2)
199
fcc.
RawRepresentation
= toolCall;
229
RawRepresentation
= tcm,
OpenAIAssistantsChatClient.cs (3)
195
fcc.
RawRepresentation
= ru;
208
RawRepresentation
= details,
225
RawRepresentation
= details,
OpenAIChatClient.cs (5)
404
RawRepresentation
= audioUpdate,
439
RawRepresentation
= tokenUsage,
531
RawRepresentation
= audio,
541
callContent.
RawRepresentation
= toolCall;
822
aiContent.
RawRepresentation
= contentPart;
OpenAIHostedFileClient.cs (2)
335
RawRepresentation
= openAIFile,
354
RawRepresentation
= file,
OpenAIRealtimeClientSession.cs (4)
1202
RawRepresentation
= mcpItem,
1226
RawRepresentation
= approvalItem,
1230
[new ToolApprovalRequestContent(approvalId, toolCall) {
RawRepresentation
= approvalItem }],
1243
RawRepresentation
= toolDef,
OpenAIResponsesChatClient.cs (34)
212
fcc.
RawRepresentation
= outputItem;
217
message.Contents.Add(new FunctionResultContent(functionCallOutputItem.CallId, functionCallOutputItem.FunctionOutput) {
RawRepresentation
= functionCallOutputItem });
229
RawRepresentation
= mtcari,
232
RawRepresentation
= mtcari,
251
RawRepresentation
= mtcari,
285
RawRepresentation
= wscri,
293
message.Contents.Add(new ToolResultContent(outputItem.Id) {
RawRepresentation
= outputItem });
297
message.Contents.Add(new ToolCallContent(computerCall.CallId) {
RawRepresentation
= computerCall });
301
message.Contents.Add(new ToolResultContent(computerCallOutput.CallId) {
RawRepresentation
= computerCallOutput });
305
message.Contents.Add(new ToolCallContent(patchCall.CallId) {
RawRepresentation
= patchCall });
309
message.Contents.Add(new ToolResultContent(patchCallOutput.CallId) {
RawRepresentation
= patchCallOutput });
313
message.Contents.Add(new() {
RawRepresentation
= outputItem });
490
RawRepresentation
= imageGenInProgress,
502
RawRepresentation
= codeInterpreterDeltaUpdate,
509
RawRepresentation
= webSearchInProgressUpdate,
532
RawRepresentation
= mtcari,
535
RawRepresentation
= mtcari,
554
RawRepresentation
= mtcari,
560
yield return CreateUpdate(new FunctionResultContent(functionCallOutputItem.CallId, functionCallOutputItem.FunctionOutput) {
RawRepresentation
= functionCallOutputItem });
581
RawRepresentation
= wscri,
621
toolCallUpdate.Contents.Add(new ToolResultContent(outputItemDoneUpdate.Item.Id) {
RawRepresentation
= outputItemDoneUpdate.Item });
626
yield return CreateUpdate(new ToolCallContent(computerCall.CallId) {
RawRepresentation
= outputItemDoneUpdate.Item });
630
yield return CreateUpdate(new ToolResultContent(computerCallOutput.CallId) {
RawRepresentation
= computerCallOutput });
635
yield return CreateUpdate(new AIContent {
RawRepresentation
= outputItemDoneUpdate.Item });
932
RawRepresentation
= rawRepresentation,
1742
content.
RawRepresentation
= part;
1831
RawRepresentation
= uriSource,
1853
RawRepresentation
= mtci,
1882
outputContents.Add(new UriContent(cicio.ImageUri, OpenAIClientExtensions.ImageUriToMediaType(cicio.ImageUri)) {
RawRepresentation
= cicio });
1886
outputContents.Add(new TextContent(ciclo.Logs) {
RawRepresentation
= ciclo });
1906
RawRepresentation
= cicri,
1954
var hfc = new HostedFileContent(fileId) { MediaType = mimeType,
RawRepresentation
= output };
1974
RawRepresentation
= outputItem,
1986
RawRepresentation
= update,
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIConversionTests.cs (4)
851
new AIContent {
RawRepresentation
= ResponseItem.CreateWebSearchCallItem() },
852
new AIContent {
RawRepresentation
= ResponseItem.CreateReferenceItem("123") },
859
new AIContent {
RawRepresentation
= ResponseItem.CreateReasoningItem("text") },
863
new AIContent {
RawRepresentation
= ResponseItem.CreateSystemMessageItem("test") },
Microsoft.Extensions.AI.Stabilization.Tests (7)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolCallContentTests.cs (1)
36
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolResultContentTests.cs (1)
36
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (1)
51
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolCallContentTests.cs (1)
29
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolResultContentTests.cs (1)
37
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolCallContentTests.cs (1)
35
c.
RawRepresentation
= raw;
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolResultContentTests.cs (1)
40
c.
RawRepresentation
= raw;
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
408
RawRepresentation
= "CustomRaw"
2335
RawRepresentation
= fcc.RawRepresentation
179 references to RawRepresentation
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatResponseExtensions.cs (2)
259
RawRepresentation = existing.
RawRepresentation
?? webSearchCall.
RawRepresentation
,
Microsoft.Extensions.AI.Abstractions.Tests (60)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (3)
1051
Assert.Same(rawRepresentation, ws1.
RawRepresentation
);
1134
Assert.Same(rawRepresentation, ws1First.
RawRepresentation
);
1140
Assert.Same(rawRepresentation, ws1Second.
RawRepresentation
);
Contents\AIContentTests.cs (5)
16
Assert.Null(c.
RawRepresentation
);
25
Assert.Null(c.
RawRepresentation
);
28
Assert.Same(raw, c.
RawRepresentation
);
45
Assert.NotNull(original.
RawRepresentation
);
53
Assert.Null(deserialized.
RawRepresentation
);
Contents\CodeInterpreterToolCallContentTests.cs (3)
16
Assert.Null(c.
RawRepresentation
);
34
Assert.Null(c.
RawRepresentation
);
37
Assert.Same(raw, c.
RawRepresentation
);
Contents\CodeInterpreterToolResultContentTests.cs (3)
16
Assert.Null(c.
RawRepresentation
);
34
Assert.Null(c.
RawRepresentation
);
37
Assert.Same(raw, c.
RawRepresentation
);
Contents\FunctionCallContentTests.cs (4)
23
Assert.Null(c.
RawRepresentation
);
41
Assert.Null(c.
RawRepresentation
);
54
Assert.Null(c.
RawRepresentation
);
57
Assert.Same(raw, c.
RawRepresentation
);
Contents\FunctionResultContentTests.cs (4)
17
Assert.Null(c.
RawRepresentation
);
27
Assert.Null(c.
RawRepresentation
);
39
Assert.Null(c.
RawRepresentation
);
42
Assert.Same(raw, c.
RawRepresentation
);
Contents\HostedFileContentTests.cs (3)
25
Assert.Null(c.
RawRepresentation
);
49
Assert.Null(c.
RawRepresentation
);
52
Assert.Same(raw, c.
RawRepresentation
);
Contents\HostedVectorStoreContentTests.cs (3)
24
Assert.Null(c.
RawRepresentation
);
43
Assert.Null(c.
RawRepresentation
);
46
Assert.Same(raw, c.
RawRepresentation
);
Contents\ImageGenerationToolCallContentTests.cs (3)
15
Assert.Null(c.
RawRepresentation
);
27
Assert.Null(c.
RawRepresentation
);
30
Assert.Same(raw, c.
RawRepresentation
);
Contents\ImageGenerationToolResultContentTests.cs (3)
17
Assert.Null(c.
RawRepresentation
);
35
Assert.Null(c.
RawRepresentation
);
38
Assert.Same(raw, c.
RawRepresentation
);
Contents\McpServerToolCallContentTests.cs (3)
18
Assert.Null(c.
RawRepresentation
);
32
Assert.Null(c.
RawRepresentation
);
35
Assert.Same(raw, c.
RawRepresentation
);
Contents\McpServerToolResultContentTests.cs (3)
18
Assert.Null(c.
RawRepresentation
);
28
Assert.Null(c.
RawRepresentation
);
31
Assert.Same(raw, c.
RawRepresentation
);
Contents\TextContentTests.cs (3)
18
Assert.Null(c.
RawRepresentation
);
28
Assert.Null(c.
RawRepresentation
);
31
Assert.Same(raw, c.
RawRepresentation
);
Contents\TextReasoningContentTests.cs (3)
18
Assert.Null(c.
RawRepresentation
);
29
Assert.Null(c.
RawRepresentation
);
32
Assert.Same(raw, c.
RawRepresentation
);
Contents\ToolCallContentTests.cs (3)
19
Assert.Null(c.
RawRepresentation
);
34
Assert.Null(c.
RawRepresentation
);
37
Assert.Same(raw, c.
RawRepresentation
);
Contents\ToolResultContentTests.cs (3)
18
Assert.Null(c.
RawRepresentation
);
33
Assert.Null(c.
RawRepresentation
);
36
Assert.Same(raw, c.
RawRepresentation
);
Contents\UsageContentTests.cs (2)
22
Assert.Null(c.
RawRepresentation
);
39
Assert.Null(c.
RawRepresentation
);
Contents\WebSearchToolCallContentTests.cs (3)
15
Assert.Null(c.
RawRepresentation
);
33
Assert.Null(c.
RawRepresentation
);
36
Assert.Same(raw, c.
RawRepresentation
);
Contents\WebSearchToolResultContentTests.cs (3)
17
Assert.Null(c.
RawRepresentation
);
38
Assert.Null(c.
RawRepresentation
);
41
Assert.Same(raw, c.
RawRepresentation
);
Microsoft.Extensions.AI.OpenAI (7)
OpenAIAssistantsChatClient.cs (1)
534
case AIContent when content.
RawRepresentation
is MessageContent rawRep:
OpenAIChatClient.cs (2)
267
if (content.
RawRepresentation
is ChatMessageContentPart raw)
292
case AIContent when content.
RawRepresentation
is ChatMessageContentPart rawContentPart:
OpenAIResponsesChatClient.cs (4)
1319
{
RawRepresentation
: ResponseItem rawRep } => rawRep,
1343
case AIContent when item.
RawRepresentation
is ResponseContentPart rawRep:
1406
case AIContent when item.
RawRepresentation
is ResponseItem rawRep:
1540
case AIContent when item.
RawRepresentation
is ResponseItem rawRep:
Microsoft.Extensions.AI.OpenAI.Tests (87)
OpenAIConversionTests.cs (54)
871
Assert.Same(messages[0].Contents[1].
RawRepresentation
, items[1]);
872
Assert.Same(messages[0].Contents[2].
RawRepresentation
, items[2]);
876
Assert.Same(messages[1].Contents[1].
RawRepresentation
, items[5]);
877
Assert.Same(messages[2].Contents[0].
RawRepresentation
, items[6]);
1030
Assert.Null(mcpToolCallContent.
RawRepresentation
); // Intentionally null to avoid duplication during roundtrip
1035
Assert.NotNull(mcpToolResultContent.
RawRepresentation
);
1036
Assert.Same(mcpToolCall, mcpToolResultContent.
RawRepresentation
);
1042
Assert.NotNull(approvalRequest.
RawRepresentation
);
1043
Assert.Same(mcpApprovalRequest, approvalRequest.
RawRepresentation
);
1054
Assert.NotNull(approvalResponse.
RawRepresentation
);
1055
Assert.Same(mcpApprovalResponse, approvalResponse.
RawRepresentation
);
1069
Assert.Null(wsToolCall.
RawRepresentation
);
1075
Assert.Same(webSearchItem, wsToolResult.
RawRepresentation
);
1081
Assert.Null(fsToolCall.
RawRepresentation
);
1086
Assert.Same(fileSearchItem, fsToolResult.
RawRepresentation
);
1092
Assert.Same(computerItem, cuToolCall.
RawRepresentation
);
1098
Assert.Same(computerOutput, cuToolResult.
RawRepresentation
);
1101
AIContent? apCallContent = updates[9].Contents.FirstOrDefault(c => c.
RawRepresentation
== applyPatchItem);
1103
Assert.Same(applyPatchItem, apCallContent.
RawRepresentation
);
1106
AIContent? apOutputContent = updates[10].Contents.FirstOrDefault(c => c.
RawRepresentation
== applyPatchOutputItem);
1108
Assert.Same(applyPatchOutputItem, apOutputContent.
RawRepresentation
);
1145
AIContent? genericContent = updates[0].Contents.FirstOrDefault(c => c.
RawRepresentation
== mcpApprovalResponse);
1148
Assert.Same(mcpApprovalResponse, genericContent.
RawRepresentation
);
1307
Assert.NotNull(textContent.
RawRepresentation
);
1308
Assert.IsAssignableFrom<ResponseContentPart>(textContent.
RawRepresentation
);
1314
Assert.NotNull(reasoningContent.
RawRepresentation
);
1315
Assert.Same(reasoningItem, reasoningContent.
RawRepresentation
);
1322
Assert.NotNull(functionCallContent.
RawRepresentation
);
1323
Assert.Same(functionCallItem, functionCallContent.
RawRepresentation
);
1330
Assert.NotNull(functionResultContent.
RawRepresentation
);
1331
Assert.Same(functionOutputItem, functionResultContent.
RawRepresentation
);
1340
Assert.Null(mcpToolCall.
RawRepresentation
); // Intentionally null to avoid duplication during roundtrip
1345
Assert.NotNull(mcpToolResult.
RawRepresentation
);
1346
Assert.Same(mcpToolCallItem, mcpToolResult.
RawRepresentation
);
1352
Assert.NotNull(approvalRequestContent.
RawRepresentation
);
1353
Assert.Same(mcpApprovalRequestItem, approvalRequestContent.
RawRepresentation
);
1359
Assert.NotNull(nestedMcpCall.
RawRepresentation
);
1360
Assert.Same(mcpApprovalRequestItem, nestedMcpCall.
RawRepresentation
);
1367
Assert.NotNull(approvalResponseContent.
RawRepresentation
);
1368
Assert.Same(mcpApprovalResponseItem, approvalResponseContent.
RawRepresentation
);
1381
Assert.Null(webSearchToolCall.
RawRepresentation
); // Intentionally null to avoid duplication during roundtrip
1385
Assert.Same(webSearchItem, webSearchToolResult.
RawRepresentation
);
1390
Assert.Null(fileSearchToolCall.
RawRepresentation
);
1394
Assert.Same(fileSearchItem, fileSearchToolResult.
RawRepresentation
);
1399
Assert.Same(computerItem, computerToolCall.
RawRepresentation
);
1404
Assert.Same(computerOutput, computerToolResult.
RawRepresentation
);
1409
Assert.Same(applyPatchItem, applyPatchToolCall.
RawRepresentation
);
1414
Assert.Same(applyPatchOutputItem, applyPatchToolResult.
RawRepresentation
);
1437
AIContent? genericContent = message.Contents.FirstOrDefault(c => c.
RawRepresentation
== mcpApprovalResponseItem);
1440
Assert.Same(mcpApprovalResponseItem, genericContent.
RawRepresentation
);
1460
Assert.NotNull(content.
RawRepresentation
);
1461
Assert.IsAssignableFrom<ResponseContentPart>(content.
RawRepresentation
);
1480
Assert.NotNull(content.
RawRepresentation
);
1481
Assert.IsAssignableFrom<ResponseContentPart>(content.
RawRepresentation
);
OpenAIHostedFileClientIntegrationTests.cs (4)
51
Assert.NotNull(uploadedFile.
RawRepresentation
);
287
if (content is CodeInterpreterToolResultContent {
RawRepresentation
: OpenAI.Responses.CodeInterpreterCallResponseItem cicri })
357
if (content is CodeInterpreterToolResultContent {
RawRepresentation
: OpenAI.Responses.CodeInterpreterCallResponseItem cicri })
405
if (content is CodeInterpreterToolResultContent {
RawRepresentation
: OpenAI.Responses.CodeInterpreterCallResponseItem cicri })
OpenAIHostedFileClientTests.cs (4)
121
Assert.NotNull(result.
RawRepresentation
);
210
Assert.NotNull(result.
RawRepresentation
);
269
Assert.NotNull(files[0].
RawRepresentation
);
276
Assert.NotNull(files[1].
RawRepresentation
);
OpenAIResponseClientIntegrationTests.cs (11)
344
.Where(c => c.
RawRepresentation
is ResponseItem)
345
.Select(c => ModelReaderWriter.Write((ResponseItem)c.
RawRepresentation
!, ModelReaderWriterOptions.Json).ToString())
720
Assert.NotNull(reasoningContent.
RawRepresentation
);
740
Assert.Null(deserializedReasoning.
RawRepresentation
);
821
Assert.Null(deserializedReasoning.
RawRepresentation
);
880
.Where(c => c.
RawRepresentation
is ResponseItem)
881
.Select(c => ModelReaderWriter.Write((ResponseItem)c.
RawRepresentation
!, ModelReaderWriterOptions.Json).ToString())
990
.Where(c => c.
RawRepresentation
is ResponseItem)
991
.Select(c => ModelReaderWriter.Write((ResponseItem)c.
RawRepresentation
!, ModelReaderWriterOptions.Json).ToString())
1040
.Where(c => c.
RawRepresentation
is ResponseItem)
1041
.Select(c => ModelReaderWriter.Write((ResponseItem)c.
RawRepresentation
!, ModelReaderWriterOptions.Json).ToString())
OpenAIResponseClientTests.cs (14)
911
Assert.NotNull(computerUserItem.
RawRepresentation
);
913
Assert.IsType<ComputerCallResponseItem>(computerUserItem.
RawRepresentation
);
1016
var ccri = Assert.IsType<ComputerCallResponseItem>(content.
RawRepresentation
);
6077
Assert.IsType<FunctionCallOutputResponseItem>(frc.
RawRepresentation
);
6856
Assert.IsType<ApplyPatchCallItem>(toolCall.
RawRepresentation
);
6861
Assert.IsType<ApplyPatchCallOutputItem>(toolResult.
RawRepresentation
);
7145
Assert.NotNull(wsResult.
RawRepresentation
);
7151
var source0Raw = Assert.IsType<WebSearchActionUriSource>(source0.
RawRepresentation
);
7156
var source1Raw = Assert.IsType<WebSearchActionUriSource>(source1.
RawRepresentation
);
7273
Assert.NotNull(wsCallInProgress.
RawRepresentation
);
7278
Assert.Null(wsCallDone.
RawRepresentation
);
7286
Assert.NotNull(wsResult.
RawRepresentation
);
7291
Assert.IsType<WebSearchActionUriSource>(streamSource.
RawRepresentation
);
7309
Assert.NotNull(coalescedWsResult.
RawRepresentation
);
Microsoft.Extensions.AI.Stabilization.Tests (21)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolCallContentTests.cs (3)
16
Assert.Null(c.
RawRepresentation
);
34
Assert.Null(c.
RawRepresentation
);
37
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolResultContentTests.cs (3)
16
Assert.Null(c.
RawRepresentation
);
34
Assert.Null(c.
RawRepresentation
);
37
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (3)
25
Assert.Null(c.
RawRepresentation
);
49
Assert.Null(c.
RawRepresentation
);
52
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolCallContentTests.cs (3)
15
Assert.Null(c.
RawRepresentation
);
27
Assert.Null(c.
RawRepresentation
);
30
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolResultContentTests.cs (3)
17
Assert.Null(c.
RawRepresentation
);
35
Assert.Null(c.
RawRepresentation
);
38
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolCallContentTests.cs (3)
15
Assert.Null(c.
RawRepresentation
);
33
Assert.Null(c.
RawRepresentation
);
36
Assert.Same(raw, c.
RawRepresentation
);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolResultContentTests.cs (3)
17
Assert.Null(c.
RawRepresentation
);
38
Assert.Null(c.
RawRepresentation
);
41
Assert.Same(raw, c.
RawRepresentation
);
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
434
Assert.Equal("CustomRaw", capturedFrc.
RawRepresentation
);
2335
RawRepresentation = fcc.
RawRepresentation