extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Provide ability to specify reject message for FunctionInvokingChatClient

Open NoofSaeidh opened this issue 3 weeks ago • 0 comments

The reject message for FunctionApprovalResponseContent with Approved = false is currently a hard-coded string:

"Error: Tool call invocation was rejected by user."

However, this situation is not necessarily an error. It should be possible to provide a custom rejection message, allowing callers to specify the actual reason for rejection.

Relevant code: https://github.com/dotnet/extensions/blob/cc328a764d1b0200a852772b1f163ebecc7f4a22/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs#L1421

NoofSaeidh avatar Dec 12 '25 15:12 NoofSaeidh