fix: improve the prompt when user decline the tool call (#1980)

This commit is contained in:
Yingjie He
2025-04-01 14:52:00 -07:00
committed by GitHub
parent 060345a348
commit a560f115c7

View File

@@ -379,7 +379,10 @@ impl Agent for TruncateAgent {
// User declined - add declined response
message_tool_response = message_tool_response.with_tool_response(
request.id.clone(),
Ok(vec![Content::text("User declined to run this tool. Don't try to make the same tool call again. If there is no other ways to do it, it is ok to stop.")]),
Ok(vec![Content::text(
"The user has declined to run this tool. \
DO NOT attempt to call this tool again. \
If there are no alternative methods to proceed, clearly explain the situation and STOP.")]),
);
}
break; // Exit the loop once the matching `req_id` is found