iteration on system prompt and edit file description

This commit is contained in:
Dallin Romney 2025-05-01 22:37:04 -07:00
parent 260866a67f
commit 319e20ad06
2 changed files with 10 additions and 9 deletions

View file

@ -24,31 +24,31 @@ export const DEFAULT_CHAT_SYSTEM_MESSAGE = `\
unmodified sections. For example:
\`\`\`language /path/to/file
// ... rest of code here ...
// ... existing code ...
{{ modified code here }}
// ... rest of code here ...
// ... existing code ...
{{ another modification }}
// ... rest of code here ...
// ... rest of code ...
\`\`\`
In existing files, you should always restate the function or class that the snippet belongs to:
\`\`\`language /path/to/file
// ... rest of code here ...
// ... existing code ...
function exampleFunction() {
// ... rest of code here ...
// ... existing code ...
{{ modified code here }}
// ... rest of code here ...
// ... rest of function ...
}
// ... rest of code here ...
// ... rest of code ...
\`\`\`
Since users have access to their complete file, they prefer reading only the
@ -100,7 +100,8 @@ export function constructMessages(
| undefined;
const systemMessage = getSystemMessageWithRules({
baseSystemMessage: baseChatOrAgentSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE,
baseSystemMessage:
baseChatOrAgentSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE,
rules,
userMessage: lastUserMsg,
});

View file

@ -30,7 +30,7 @@ export const editFileTool: Tool = {
changes: {
type: "string",
description:
"Any modifications to the file, showing only needed changes. Do NOT wrap this in a codeblock. Use brief language-appropriate placeholders for large unmodified sections, e.g. '// ... rest of code here ...'",
"Any modifications to the file, showing only needed changes. Do NOT wrap this in a codeblock or write anything besides the code changes. In larger files, use brief language-appropriate placeholders for large unmodified sections, e.g. '// ... existing code ...'",
},
},
},