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:
|
rejections.ConvertAll(static m => (AIContent)new FunctionResultContent(m.Response.FunctionCall.CallId, "Error: Tool call invocation was rejected by user.")) : |
The reject message for
FunctionApprovalResponseContentwithApproved = falseis currently a hard-coded string: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:
extensions/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs
Line 1421 in cc328a7