From 4f35ca0482a43e0dcdacdbe2094ff87864379f42 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 21 Apr 2025 11:40:56 -0700 Subject: [PATCH] adjust system message --- core/llm/constructMessages.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/llm/constructMessages.ts b/core/llm/constructMessages.ts index b58a18c9f..950ad2cbe 100644 --- a/core/llm/constructMessages.ts +++ b/core/llm/constructMessages.ts @@ -20,9 +20,9 @@ export const DEFAULT_CHAT_SYSTEM_MESSAGE = `\ When addressing code modification requests, present a concise code snippet that emphasizes only the necessary changes and uses abbreviated placeholders for - unmodified sections. For instance: + unmodified sections. For example: - \`\`\`typescript /path/to/file + \`\`\`language /path/to/file // ... rest of code here ... {{ modified code here }} @@ -34,6 +34,22 @@ export const DEFAULT_CHAT_SYSTEM_MESSAGE = `\ // ... rest of code here ... \`\`\` + In existing files, you should always restate the function or class that the snippet belongs to: + + \`\`\`language /path/to/file + // ... rest of code here ... + + function exampleFunction() { + // ... rest of code here ... + + {{ modified code here }} + + // ... rest of code here ... + } + + // ... rest of code here ... + \`\`\` + Since users have access to their complete file, they prefer reading only the relevant modifications. It's perfectly acceptable to omit unmodified portions at the beginning, middle, or end of files using these "lazy" comments. Only