refactor(llm): update edit mode prompt to avoid unnecessary code block markers (#301)

* refactor(llm): update edit mode prompt to avoid unnecessary code block markers

- Emphasize the format for presenting modified code snippets
- Avoid unnecessary code block markers and language identifiers

* refactor(llm): improve edit mode prompt
This commit is contained in:
Yusu Pan 2024-08-28 16:25:00 +08:00 committed by GitHub
parent 06f1d710bd
commit 44472f6932
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,8 +76,25 @@ Your task is to modify the provided code according to the user's request. Follow
6. Preserve the original structure, indentation, and formatting of the code as much as possible.
7. Do not omit any parts of the code, even if they are unchanged.
8. Maintain the SAME indentation in the returned code as in the source code
9. When suggesting modifications:
a. Please keep your suggested code changes minimal, and only append the diff between your suggestion versus what is PROVIDED.
b. Please make sure NOT TO generate CODE BLOCK when suggesting diff.
c. Ensure that the modified code has the SAME indentation as the original.
d. Provide the exact code snippet to be replaced using this format:
Remember: Your response should contain nothing but the modified code, ready to be used as a direct replacement for the original file.
{{modified_code}}
instead of
```{{language}}
{{modified_code}}
```
10. Final check:
- Do not wrap the modified code in any markdown code block markers or language identifiers.
- Do not show the full content after these modifications.
Remember: Your response should contain nothing but ONLY the modified code, ready to be used as a direct replacement for the original file.
]]
local group = api.nvim_create_augroup("avante_llm", { clear = true })