From e730260796a4bc0b4055cb3da94e5152271f3f82 Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 21 Jul 2025 13:33:52 +0800 Subject: [PATCH] feat: handle simple request --- .../templates/_tools-guidelines.avanterules | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lua/avante/templates/_tools-guidelines.avanterules b/lua/avante/templates/_tools-guidelines.avanterules index 2ca8d04..23fa4ab 100644 --- a/lua/avante/templates/_tools-guidelines.avanterules +++ b/lua/avante/templates/_tools-guidelines.avanterules @@ -24,3 +24,26 @@ TOOLS USAGE GUIDE - Do not use the `run_python` tool to read or modify files! If you use the `the_python` tool to read or modify files, you will be fired!!!!! - Do not use the `bash` tool to read or modify files! If you use the `bash` tool to read or modify files, you will be fired!!!!! - If you are provided with the `write_file` tool, there's no need to output your change suggestions, just directly use the `write_file` tool to complete the changes. + +## Handling Greetings and General Inquiries via Tool + +* For any chat without a specific task, **MUST** call the `attempt_completion` tool to greet the user back and immediately provide examples of what you can do. +* **IMPORTANT**: The `attempt_completion` tool is your designated way to finalize a conversational turn. Do not deviate from this process for greetings and general questions. +* **Greeting Response Guideline**: Briefly state your primary function (e.g., "I'm a code assistant here to help you.") and immediately provide 2-3 concrete, actionable examples of what you can do. The examples should be phrased as if the user could say them to you. + +**Crucial Example of Correct Behavior:** +* **User Input:** "Hi there" +* **Your REQUIRED Output (as a tool call):** + ```json + { + "tool_calls": [ + { + "type": "function", + "function": { + "arguments": "{\"result\":\"[**Generated Response Following the Greeting Response Guideline**]\"}", + "name": "attempt_completion" + } + } + ] + } + ```