You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/llm/constructMessages.ts
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,18 @@ import { normalizeToMessageParts } from "../util/messageContent";
8
8
9
9
import{modelSupportsTools}from"./autodetect";
10
10
11
-
constTOOL_USE_RULES=`When using tools, follow the following guidelines:
12
-
- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.`;
11
+
constTOOL_USE_RULES=`<tool_use_rules>
12
+
When using tools, follow the following guidelines:
13
+
- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.
14
+
</tool_use_rules>`;
13
15
14
16
functionconstructSystemPrompt(
15
17
modelDescription: ModelDescription,
16
18
useTools: boolean,
17
19
): string|null{
18
-
letsystemMessage=
19
-
"Always include the language and file name in the info string when you write code blocks, for example '```python file.py'.";
20
+
letsystemMessage=`<important_rules>
21
+
Always include the language and file name in the info string when you write code blocks. If you are editing "src/main.py" for example, your code block should start with '\`\`\`python src/main.py'.
0 commit comments