1 write to CallId
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
28CallId = Throw.IfNull(callId);
54 references to CallId
Microsoft.Extensions.AI (15)
ChatCompletion\FunctionInvokingChatClient.cs (10)
1216frc.CallId == result.CallContent.CallId) 1240return new FunctionResultContent(result.CallContent.CallId, functionResult) { Exception = result.Exception }; 1279new(OpenTelemetryConsts.GenAI.Tool.Call.Id, context.CallContent.CallId), 1469_ = (approvalRequestCallIds ??= []).Add(farc.FunctionCall.CallId); 1475_ = approvalRequestCallIds?.Remove(farc.FunctionCall.CallId); 1534if (functionResultCallIds?.Contains(approvalResponse.FunctionCall.CallId) is true) 1545_ = allApprovalRequestsMessages?.TryGetValue(approvalResponse.FunctionCall.CallId, out requestMessage); 1573return (AIContent)new FunctionResultContent(m.Response.FunctionCall.CallId, result); 1714updatedContent[i] = new FunctionApprovalRequestContent(fcc.CallId, fcc); 1769message.Contents[contentIndex] = new FunctionApprovalRequestContent(functionCall.CallId, functionCall);
ChatCompletion\ImageGeneratingChatClient.cs (4)
338ImageId = functionCall.CallId, 376var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.CallId; 411var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.CallId; 429var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.CallId;
ChatCompletion\OpenTelemetryChatClient.cs (1)
264Id = fcc.CallId,
Microsoft.Extensions.AI.Abstractions (3)
Contents\FunctionCallContent.cs (2)
119if (CallId is not null) 121display += $"{CallId}, ";
Contents\FunctionResultContent.cs (1)
39/// <see cref="FunctionCallContent.CallId"/> value.
Microsoft.Extensions.AI.Abstractions.Tests (14)
ChatCompletion\ChatMessageTests.cs (1)
329Assert.Equal("function-id", functionCallContent.CallId);
Contents\FunctionApprovalRequestContentTests.cs (2)
90Assert.Equal(content.FunctionCall.CallId, deserializedContent.FunctionCall.CallId);
Contents\FunctionApprovalResponseContentTests.cs (2)
56Assert.Equal(content.FunctionCall.CallId, deserializedContent.FunctionCall.CallId);
Contents\FunctionCallContentTests.cs (9)
26Assert.Equal("callId1", c.CallId); 45Assert.Equal("id", c.CallId); 64Assert.Equal("callId1", c.CallId); 124Assert.Equal("callId1", deserialized.CallId); 137Assert.Equal("callId1", deserialized.CallId); 153Assert.Equal(original.CallId, deserialized.CallId); 172Assert.Equal("callId1", deserializedSut.CallId); 392Assert.Equal("callId", content.CallId);
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
76var toolCallJson = JsonSerializer.Serialize(new { fcc.CallId, fcc.Name, fcc.Arguments }, _jsonOptions);
Microsoft.Extensions.AI.OpenAI (4)
MicrosoftExtensionsAIChatExtensions.cs (2)
70.OfType<FunctionCallContent>().Select(c => ChatToolCall.CreateFunctionToolCall(c.CallId, c.Name, 153fcc.CallId,
OpenAIChatClient.cs (1)
202ChatToolCall.CreateFunctionToolCall(fc.CallId, fc.Name, new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIResponsesChatClient.cs (1)
1084callContent.CallId,
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (1)
1346Assert.Equal("call_F9ZaqPWo69u0urxAhVt8meDW", fcc.CallId);
OpenAIConversionTests.cs (1)
972Assert.Equal("call123", functionCall.CallId);
Microsoft.Extensions.AI.Tests (15)
ChatCompletion\DistributedCachingChatClientTest.cs (4)
820Assert.Equal(expectedFcc.CallId, actualFcc.CallId); 854Assert.Equal(expectedFcc.CallId, actualFcc.CallId);
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (5)
997if (functionCall.CallId == "callId1") 1002else if (functionCall.CallId == "callId2") 1088Assert.Equal("callId1", approvalRequest1.FunctionCall.CallId); 1096Assert.Equal("callId2", approvalRequest2.FunctionCall.CallId); 1104Assert.Equal("callId1", approvalRequest3.FunctionCall.CallId);
ChatCompletion\FunctionInvokingChatClientTests.cs (4)
406returnedFrc = new FunctionResultContent(ctx.CallContent.CallId, "Custom result from function") 569returnedFrc = new DerivedFunctionResultContent(ctx.CallContent.CallId, "Derived result") 2112Assert.Contains(response.Messages, m => m.Contents.Any(c => c is FunctionCallContent fcc && fcc.CallId == "callId1" && !fcc.InvocationRequired)); 2261cloned.Add(new FunctionCallContent(fcc.CallId, fcc.Name, fcc.Arguments)
ChatReduction\SummarizingChatReducerTests.cs (2)
219Assert.Contains(resultList, m => m.Contents.Any(c => c is FunctionCallContent fc && fc.CallId == "call2")); 221Assert.DoesNotContain(resultList, m => m.Contents.Any(c => c is FunctionCallContent fc && fc.CallId == "call1"));