Skip to content

AutoFunctionInvocationFilter - terminating function execution #9629

Answered by dmytrostruk
deepinderdeol asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @deepinderdeol , thanks for your question!

Here we can call context.Terminate( ) to stop further function execution but this seems to cause issues with chat-history because Assistant message had three tool calls but only one tool message.

Yes, if you terminate function execution, but you still want to use the same chat history for further requests, you have to manually update chat history with some response for specific tool_call_id, like in this example:

// Invoking the function
FunctionResultContent resultContent = await functionCall.InvokeAsync(kernel);
/…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@deepinderdeol
Comment options

Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants