1 write to CallId
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
28
CallId
= Throw.IfNull(callId);
60 references to CallId
Microsoft.Extensions.AI (18)
ChatCompletion\FunctionInvokingChatClient.cs (13)
881
/// if there is a matching <see cref="FunctionResultContent"/> with the same <see cref="FunctionCallContent.
CallId
"/> in the same set of messages,
914
if (contents[j] is FunctionCallContent fcc && !fcc.InformationalOnly && resultCallIds.Contains(fcc.
CallId
))
924
/// if there is a matching <see cref="FunctionResultContent"/> with the same <see cref="FunctionCallContent.
CallId
"/>, regardless of order.
959
if (resultCallIds.Contains(functionCallContents[i].
CallId
))
1342
frc.CallId == result.CallContent.
CallId
)
1366
return new FunctionResultContent(result.CallContent.
CallId
, functionResult) { Exception = result.Exception };
1405
new(OpenTelemetryConsts.GenAI.Tool.Call.Id, context.CallContent.
CallId
),
1595
_ = (approvalRequestCallIds ??= []).Add(farc.FunctionCall.
CallId
);
1601
_ = approvalRequestCallIds?.Remove(farc.FunctionCall.
CallId
);
1660
if (functionResultCallIds?.Contains(approvalResponse.FunctionCall.
CallId
) is true)
1699
return (AIContent)new FunctionResultContent(m.Response.FunctionCall.
CallId
, result);
1840
updatedContent[i] = new FunctionApprovalRequestContent(fcc.
CallId
, fcc);
1895
message.Contents[contentIndex] = new FunctionApprovalRequestContent(functionCall.
CallId
, functionCall);
ChatCompletion\ImageGeneratingChatClient.cs (4)
338
ImageId = functionCall.
CallId
,
376
var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.
CallId
;
411
var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.
CallId
;
429
var callId = FunctionInvokingChatClient.CurrentContext?.CallContent.
CallId
;
ChatCompletion\OpenTelemetryChatClient.cs (1)
318
Id = fcc.
CallId
,
Microsoft.Extensions.AI.Abstractions (3)
Contents\FunctionCallContent.cs (2)
119
if (
CallId
is not null)
121
display += $"{
CallId
}, ";
Contents\FunctionResultContent.cs (1)
39
/// <see cref="FunctionCallContent.
CallId
"/> value.
Microsoft.Extensions.AI.Abstractions.Tests (14)
ChatCompletion\ChatMessageTests.cs (1)
329
Assert.Equal("function-id", functionCallContent.
CallId
);
Contents\FunctionApprovalRequestContentTests.cs (2)
90
Assert.Equal(content.FunctionCall.
CallId
, deserializedContent.FunctionCall.
CallId
);
Contents\FunctionApprovalResponseContentTests.cs (2)
56
Assert.Equal(content.FunctionCall.
CallId
, deserializedContent.FunctionCall.
CallId
);
Contents\FunctionCallContentTests.cs (9)
26
Assert.Equal("callId1", c.
CallId
);
45
Assert.Equal("id", c.
CallId
);
64
Assert.Equal("callId1", c.
CallId
);
124
Assert.Equal("callId1", deserialized.
CallId
);
137
Assert.Equal("callId1", deserialized.
CallId
);
153
Assert.Equal(original.
CallId
, deserialized.
CallId
);
172
Assert.Equal("callId1", deserializedSut.
CallId
);
392
Assert.Equal("callId", content.
CallId
);
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
76
var toolCallJson = JsonSerializer.Serialize(new { fcc.
CallId
, fcc.Name, fcc.Arguments }, _jsonOptions);
Microsoft.Extensions.AI.OpenAI (4)
MicrosoftExtensionsAIChatExtensions.cs (2)
74
.OfType<FunctionCallContent>().Select(c => ChatToolCall.CreateFunctionToolCall(c.
CallId
, c.Name,
158
fcc.
CallId
,
OpenAIChatClient.cs (1)
214
ChatToolCall.CreateFunctionToolCall(fc.
CallId
, fc.Name, new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIResponsesChatClient.cs (1)
1160
callContent.
CallId
,
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAIChatClientTests.cs (1)
1348
Assert.Equal("call_F9ZaqPWo69u0urxAhVt8meDW", fcc.
CallId
);
OpenAIConversionTests.cs (1)
974
Assert.Equal("call123", functionCall.
CallId
);
OpenAIResponseClientTests.cs (1)
5432
Assert.Equal("call_123", fcc.
CallId
);
Microsoft.Extensions.AI.Tests (17)
ChatCompletion\DistributedCachingChatClientTest.cs (4)
820
Assert.Equal(expectedFcc.
CallId
, actualFcc.
CallId
);
854
Assert.Equal(expectedFcc.
CallId
, actualFcc.
CallId
);
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (5)
994
if (functionCall.
CallId
== "callId1")
1002
else if (functionCall.
CallId
== "callId2")
1088
Assert.Equal("callId1", approvalRequest1.FunctionCall.
CallId
);
1096
Assert.Equal("callId2", approvalRequest2.FunctionCall.
CallId
);
1104
Assert.Equal("callId1", approvalRequest3.FunctionCall.
CallId
);
ChatCompletion\FunctionInvokingChatClientTests.cs (6)
406
returnedFrc = new FunctionResultContent(ctx.CallContent.
CallId
, "Custom result from function")
569
returnedFrc = new DerivedFunctionResultContent(ctx.CallContent.
CallId
, "Derived result")
2169
Assert.Contains(response.Messages, m => m.Contents.Any(c => c is FunctionCallContent fcc && fcc.
CallId
== "callId1" && fcc.InformationalOnly));
2318
cloned.Add(new FunctionCallContent(fcc.
CallId
, fcc.Name, fcc.Arguments)
3489
m.Contents.Any(c => c is FunctionCallContent fcc2 && fcc2.
CallId
== "callId1" && fcc2.InformationalOnly));
3567
m.Contents.Any(c => c is FunctionCallContent fcc2 && fcc2.
CallId
== "callId1" && fcc2.InformationalOnly));
ChatReduction\SummarizingChatReducerTests.cs (2)
219
Assert.Contains(resultList, m => m.Contents.Any(c => c is FunctionCallContent fc && fc.
CallId
== "call2"));
221
Assert.DoesNotContain(resultList, m => m.Contents.Any(c => c is FunctionCallContent fc && fc.
CallId
== "call1"));