Pausing Tool Calls in C# Semantic Kernel to Request User Input #10673
-
I am using C# Semantic Kernel (1.38.0-alpha). I am wondering how I can temporarily stop the model from making tool calls to, for example, ask the user an intermediate question. An example of this: User input: "Give me the information about organization 'example'." Now, a kernel function is called, which returns three results. Before the model proceeds with calling other functions, I want the user to first choose one of the organizations. I tried solving this using an IAutoFunctionInvocationFilter, but it does not work when I set a schema on an agent using AssistantResponseFormat.CreateJsonSchemaFormat(). However, if I change this JSON schema to another option in the class, such as AssistantResponseFormat.JsonObject, it does work. Could it be that IAutoFunctionInvocationFilter does not work in combination with AssistantResponseFormat.CreateJsonSchemaFormat(), or should I approach this differently? If so, how? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, here are two options to prompt the user during function calling: Manual function calling: semantic-kernel/dotnet/samples/Concepts/FunctionCalling/FunctionCalling.cs at main · microsoft/semantic-kernel Or Try using an AutoFunctionInvocationFilter: semantic-kernel/dotnet/samples/Concepts/Filtering/AutoFunctionInvocationFiltering.cs at main · microsoft/semantic-kernel |
Beta Was this translation helpful? Give feedback.
Hi, here are two options to prompt the user during function calling:
Manual function calling: semantic-kernel/dotnet/samples/Concepts/FunctionCalling/FunctionCalling.cs at main · microsoft/semantic-kernel
Or
Try using an AutoFunctionInvocationFilter: semantic-kernel/dotnet/samples/Concepts/Filtering/AutoFunctionInvocationFiltering.cs at main · microsoft/semantic-kernel