-
Notifications
You must be signed in to change notification settings - Fork 849
Closed
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI libraries
Description
FunctionInvokingChatClient provides a FunctionInvocationContext that contains ChatOptions when invoking function tools.
If one of the executed functions modifies the Tools list on ChatOptions, this updated set of tools will be advertised to the downstream ChatClient. However, FunctionInvokingChatClient does not respect these updates when invoking subsequent functions, which can cause failures. FunctionInvokingChatClient currently caches a dictionary of tool name to tool, which is calculated at the start of the function loop, and before any modifications might happen.
Here is a step by step workflow explaining how a failure may happen:
- FICC is called, and it calls the downstream ChatClient.
- FICC gets a FCC back and FICC calls the appropriate Function tool (lets say Function A)
- Function A modifies ChatOptions.Tools on FunctionInvocationContext by adding Function B to the list.
- FICC calls the downstream ChatClient.
- FICC gets a FCC back for Function B.
- FICC fails to invoke Function B, saying that it cannot find Function B
Also see microsoft/agent-framework#3083
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI libraries