Merge pull request #88 from devchat-ai/improve-prompts-for-explain

Improve explain prompts
This commit is contained in:
boob.yang 2024-04-11 11:00:13 +08:00 committed by GitHub
commit 1d57a9424e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,8 @@ EXPLAIN_PROMPT = prompt = """
Your task is:
Explain the code.
Following the task requirements, explain the selected portion of the code. \
Note that you only explain the logic of the selected code. \
The visible code only serves as the context for you to understand the code. \
Here is the relevant context \
information for your reference:
1. selected code info: {selected_text}
@ -57,8 +59,9 @@ information for your reference:
EXPLAIN_PROMPT_ZH = prompt = """
你的任务是
解释代码
根据任务要求解释被选中部分的代码你可以参考的 context
使用中文解释代码
根据任务要求解释被选中部分的代码注意只解释被选中的代码逻辑\
可见代码只是作为你理解代码的 context你可以参考的 context
1. 编辑器中被选中的代码{selected_text}
2. 当前编辑器中可见代码{visible_text}
"""