1 write to CallId
Microsoft.Extensions.AI.Abstractions (1)
Contents\ToolResultContent.cs (1)
27CallId = Throw.IfNull(callId);
167 references to CallId
Microsoft.Extensions.AI (13)
ChatCompletion\FunctionInvokingChatClient.cs (4)
937_ = (resultCallIds ??= []).Add(frc.CallId); 986_ = (resultCallIds ??= []).Add(frc.CallId); 1287frc.CallId == result.CallContent.CallId) 1466_ = (functionResultCallIds ??= []).Add(frc.CallId);
ChatCompletion\ImageGeneratingChatClient.cs (3)
340_imageContentByCallId.TryGetValue(functionResult.CallId, out var imageContents)) 348newContents.Add(new ImageGenerationToolResultContent(functionResult.CallId) 355_ = _imageContentByCallId.Remove(functionResult.CallId);
Common\OtelMessageSerializer.cs (4)
89Id = frc.CallId, 148Id = citrc.CallId, 168Id = igtrc.CallId, 192Id = mstrc.CallId,
Realtime\OpenTelemetryRealtimeClientSession.cs (2)
551Id = frc.CallId, 612Id = mstrc.CallId,
Microsoft.Extensions.AI.Abstractions (13)
ChatCompletion\ChatResponseExtensions.cs (5)
207if (imageResultIndexById.TryGetValue(imageResult.CallId, out int existingIndex)) 216imageResultIndexById[imageResult.CallId] = i; 388canMerge: static (r1, r2) => r1.CallId == r2.CallId, 415return new(firstContent.CallId)
Contents\FunctionResultContent.cs (2)
62if (CallId is not null) 64display += $"{CallId}, ";
Generated\361d1da7f942c932\JsonContext.CodeInterpreterToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.ImageGenerationToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.WebSearchToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionResultContent.g.cs (1)
100Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ToolResultContent.g.cs (1)
60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Microsoft.Extensions.AI.Abstractions.Tests (42)
ChatCompletion\ChatMessageTests.cs (2)
337Assert.Equal("function-id", functionResultContent.CallId); 394Assert.Equal("call1", funcResult.CallId);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (2)
964var firstImageResult = imageResults.First(ir => ir.CallId == "img1"); 970var secondImageResult = imageResults.First(ir => ir.CallId == "img2");
Contents\CodeInterpreterToolResultContentTests.cs (4)
18Assert.Equal("callId1", c.CallId); 27Assert.Equal("call123", c.CallId); 83Assert.Equal("call123", deserializedSut.CallId); 115Assert.Equal("ci-call1", ciResult.CallId);
Contents\FunctionResultContentTests.cs (10)
16Assert.Equal("callId1", c.CallId); 29Assert.Equal("id", c.CallId); 49Assert.Equal("callId1", c.CallId); 74Assert.Equal(sut.CallId, deserializedSut.CallId); 90Assert.Equal(sut.CallId, deserializedSut.CallId); 112Assert.Equal(content.CallId, deserializedContent.CallId); 135Assert.Equal("call123", funcResult.CallId);
Contents\ImageGenerationToolResultContentTests.cs (5)
19Assert.Equal("call123", c.CallId); 28Assert.Equal("img123", c.CallId); 82Assert.Equal("img123", deserializedSut.CallId); 113Assert.Equal("img789", imageResult.CallId); 144Assert.Equal("img-call1", imgResult.CallId);
Contents\McpServerToolResultContentTests.cs (5)
17Assert.Equal("callId", c.CallId); 38Assert.Equal("callId", c.CallId); 73Assert.Equal(content.CallId, deserializedContent.CallId); 102Assert.Equal("call1", mcpResult.CallId);
Contents\ToolResultContentTests.cs (3)
17Assert.Equal("callId1", c.CallId); 43Assert.Equal("callId1", c.CallId); 101Assert.Equal("tr1", toolResult.CallId);
Contents\WebSearchToolResultContentTests.cs (5)
19Assert.Equal("callId", c.CallId); 28Assert.Equal("ws_call123", c.CallId); 91Assert.Equal("ws_call123", deserialized.CallId); 118Assert.Equal("ws_call456", result.CallId); 150Assert.Equal("ws-call1", wsResult.CallId);
Generated\361d1da7f942c932\TestJsonSerializerContext.CodeInterpreterToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.FunctionResultContent.g.cs (1)
98Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.ImageGenerationToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolResultContent.g.cs (1)
58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.WebSearchToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Microsoft.Extensions.AI.Evaluation.Reporting (6)
Generated\361d1da7f942c932\JsonContext.CodeInterpreterToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.ImageGenerationToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.WebSearchToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionResultContent.g.cs (1)
100Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ToolResultContent.g.cs (1)
60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (6)
Generated\361d1da7f942c932\JsonContext.CodeInterpreterToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.ImageGenerationToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\JsonContext.WebSearchToolResultContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionResultContent.g.cs (1)
100Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ToolResultContent.g.cs (1)
60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
71var toolCallResultJson = JsonSerializer.Serialize(new ToolCallResult { Id = frc.CallId, Result = frc.Result }, _jsonOptions);
Microsoft.Extensions.AI.OpenAI (8)
OpenAIAssistantsChatClient.cs (1)
583runAndCallIDs = JsonSerializer.Deserialize(frc.CallId, OpenAIJsonContext.Default.StringArray);
OpenAIChatClient.cs (1)
200yield return new ToolChatMessage(resultContent.CallId, result ?? string.Empty);
OpenAIRealtimeClientSession.cs (1)
642functionResult.CallId ?? string.Empty,
OpenAIResponsesChatClient.cs (5)
1503yield return SerializeAIContent(resultContent.CallId, [ac]); 1507yield return SerializeAIContent(resultContent.CallId, items); 1524yield return ResponseItem.CreateFunctionCallOutputItem(resultContent.CallId, result ?? string.Empty); 1598if (idToContentMapping?.TryGetValue(mstrc.CallId, out McpServerToolCallContent? associatedCall) is true) 1600_ = idToContentMapping.Remove(mstrc.CallId);
Microsoft.Extensions.AI.OpenAI.Tests (33)
OpenAIAssistantChatClientIntegrationTests.cs (2)
87if (toolResultContent.CallId is not null) 89Assert.NotEmpty(toolResultContent.CallId);
OpenAIChatClientTests.cs (1)
1799Assert.Equal("tool-123", frc.CallId);
OpenAIConversionTests.cs (11)
1034Assert.Equal("mcp_call_123", mcpToolResultContent.CallId); 1074Assert.Equal("ws_123", wsToolResult.CallId); 1085Assert.Equal("fs_123", fsToolResult.CallId); 1097Assert.Equal("call_456", cuToolResult.CallId); 1328Assert.Equal("call_abc", functionResultContent.CallId); 1342McpServerToolResultContent? mcpToolResult = message.Contents.OfType<McpServerToolResultContent>().FirstOrDefault(c => c.CallId == "mcp_call_123"); 1344Assert.Equal("mcp_call_123", mcpToolResult.CallId); 1383WebSearchToolResultContent? webSearchToolResult = message.Contents.OfType<WebSearchToolResultContent>().FirstOrDefault(c => c.CallId == "ws_123"); 1392ToolResultContent? fileSearchToolResult = message.Contents.OfType<ToolResultContent>().FirstOrDefault(c => c.CallId == "fs_123"); 1402ToolResultContent? computerToolResult = message.Contents.OfType<ToolResultContent>().FirstOrDefault(c => c.CallId == "call_456"); 1412ToolResultContent? applyPatchToolResult = message.Contents.OfType<ToolResultContent>().FirstOrDefault(c => c.CallId == "call_patch_789");
OpenAIResponseClientIntegrationTests.cs (4)
64Assert.NotNull(toolResultContent.CallId); 65Assert.NotEmpty(toolResultContent.CallId); 106Assert.Equal(wsCall.CallId, wsResult.CallId); 171Assert.Equal(igCall.CallId, igResult.CallId);
OpenAIResponseClientTests.cs (15)
1643Assert.Equal("mcp_06ee3b1962eeb8470068e6b21cbaa081a3b5aa2a6c989f4c6f", result.CallId); 2019Assert.Equal("mcp_68be4166acfc8191bc5e0a751eed358b0384f747588fc3f5", firstResult.CallId); 2031Assert.Equal("mcp_68be416900f88191837ae0718339a4ce0384f747588fc3f5", secondResult.CallId); 2430Assert.Equal("mcp_68be4503d45c819e89cb574361c8eba003a2537be0e84a54", firstResult.CallId); 2442Assert.Equal("mcp_68be4505f134819e806c002f27cce0c303a2537be0e84a54", secondResult.CallId); 2638Assert.Equal("mcp_689023b0fa88819f99f48aff343d5ad50475557f6fefb5f0", toolResult.CallId); 3403Assert.Equal(codeCall.CallId, codeResult.CallId); 3623Assert.Equal(codeCall.CallId, codeResult.CallId); 3750Assert.Equal("ci_05d8f42f04f94cb80068fc3b80fba8819ea3bfbdd36e94bcf3", codeResult.CallId); 6075Assert.Equal("call_123", frc.CallId); 6388Assert.Equal("img_call_abc123", toolResult.CallId); 6860Assert.Equal("call_patch_001", toolResult.CallId); 7144Assert.Equal("ws_0ed9cd9f8606486b0069888072b3d08190818b61da9cf032a7", wsResult.CallId); 7285Assert.Equal("ws_02441a08b3f3bf4b00698880914730819eb48b3ae0c359bff3", wsResult.CallId); 7308Assert.Equal(coalescedWsCall.CallId, coalescedWsResult.CallId);
Microsoft.Extensions.AI.Stabilization.Tests (20)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.CodeInterpreterToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.FunctionResultContent.g.cs (1)
98Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.ImageGenerationToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.McpServerToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.ToolResultContent.g.cs (1)
58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.WebSearchToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolResultContentTests.cs (4)
18Assert.Equal("callId1", c.CallId); 27Assert.Equal("call123", c.CallId); 83Assert.Equal("call123", deserializedSut.CallId); 115Assert.Equal("ci-call1", ciResult.CallId);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolResultContentTests.cs (5)
19Assert.Equal("call123", c.CallId); 28Assert.Equal("img123", c.CallId); 82Assert.Equal("img123", deserializedSut.CallId); 113Assert.Equal("img789", imageResult.CallId); 144Assert.Equal("img-call1", imgResult.CallId);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolResultContentTests.cs (5)
19Assert.Equal("callId", c.CallId); 28Assert.Equal("ws_call123", c.CallId); 91Assert.Equal("ws_call123", deserialized.CallId); 118Assert.Equal("ws_call456", result.CallId); 150Assert.Equal("ws-call1", wsResult.CallId);
Microsoft.Extensions.AI.Tests (25)
ChatCompletion\FunctionInvokingChatClientTests.cs (10)
435Assert.Equal("callId1", capturedFrc.CallId); 512Assert.Equal("callId1", frc.CallId); 515Assert.Equal("differentCallId", innerFrc.CallId); 599Assert.Equal("callId1", derivedFrc.CallId); 2135Assert.Contains(response.Messages, m => m.Contents.Any(c => c is FunctionResultContent frc && frc.CallId == "callId1")); 2136Assert.DoesNotContain(response.Messages, m => m.Contents.Any(c => c is FunctionResultContent frc && frc.CallId == "callId2")); 2183Assert.Contains(response.Messages, m => m.Contents.Any(c => c is FunctionResultContent frc && frc.CallId == "callId1")); 3504m.Contents.Any(c => c is FunctionResultContent frc2 && frc2.CallId == "callId1")); 3582m.Contents.Any(c => c is FunctionResultContent frc2 && frc2.CallId == "callId2")); 3640m.Contents.Any(c => c is FunctionResultContent frc2 && frc2.CallId == "callId1"));
ChatCompletion\ImageGeneratingChatClientTests.cs (6)
438Assert.Equal(otherCallId, otherResult.CallId); 444Assert.Equal(otherCallId, otherResult.CallId); 451Assert.Equal(otherCallId, beforeResult.CallId); 515Assert.Equal(otherCallId, otherResult.CallId); 521Assert.Equal(otherCallId, otherResult.CallId); 528Assert.Equal(otherCallId, beforeResult.CallId);
ChatReduction\SummarizingChatReducerTests.cs (2)
220Assert.Contains(resultList, m => m.Contents.Any(c => c is FunctionResultContent fr && fr.CallId == "call2")); 222Assert.DoesNotContain(resultList, m => m.Contents.Any(c => c is FunctionResultContent fr && fr.CallId == "call1"));
Generated\361d1da7f942c932\TestJsonSerializerContext.CodeInterpreterToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.FunctionResultContent.g.cs (1)
98Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.ImageGenerationToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolResultContent.g.cs (1)
58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Generated\361d1da7f942c932\TestJsonSerializerContext.WebSearchToolResultContent.g.cs (1)
78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolResultContent)obj).CallId,
Realtime\FunctionInvokingRealtimeClientTests.cs (1)
130Assert.Equal("call_001", functionResult.CallId);