You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs
+34-9Lines changed: 34 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -284,7 +284,7 @@ public override async Task<ChatResponse> GetResponseAsync(
284
284
boollastIterationHadConversationId=false;// whether the last iteration's response had a ConversationId set
285
285
intconsecutiveErrorCount=0;
286
286
287
-
(Dictionary<string,AITool>?toolMap,boolanyToolsRequireApproval)=CreateToolsMap(AdditionalTools,options?.Tools);// all available tools, indexed by name
287
+
(Dictionary<string,AITool>?toolMap,boolanyToolsRequireApproval)=awaitCreateToolsMapAsync([AdditionalTools,options?.Tools],cancellationToken);// all available tools, indexed by name
288
288
289
289
if(HasAnyApprovalContent(originalMessages))
290
290
{
@@ -424,7 +424,7 @@ public override async IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseA
424
424
List<ChatResponseUpdate>updates=[];// updates from the current response
425
425
intconsecutiveErrorCount=0;
426
426
427
-
(Dictionary<string,AITool>?toolMap,boolanyToolsRequireApproval)=CreateToolsMap(AdditionalTools,options?.Tools);// all available tools, indexed by name
427
+
(Dictionary<string,AITool>?toolMap,boolanyToolsRequireApproval)=awaitCreateToolsMapAsync([AdditionalTools,options?.Tools],cancellationToken);// all available tools, indexed by name
428
428
429
429
// This is a synthetic ID since we're generating the tool messages instead of getting them from
430
430
// the underlying provider. When emitting the streamed chunks, it's perfectly valid for us to
0 commit comments