adjusting prompt

This commit is contained in:
Nate 2024-09-11 14:54:57 -07:00
parent 64e50ec1fa
commit d460d4ff09

View file

@ -9,6 +9,15 @@ type LazyApplyPrompt = (
newCode: string,
) => ChatMessage[];
const RULES = [
`Your response should be a code block containing a new version of the entire file.`,
`Whenever any part of the code is the same as before, you may simply indicate this with a comment that says "${UNCHANGED_CODE}" instead of rewriting.`,
`You should write "${UNCHANGED_CODE}" at least for each function that is unchanged, rather than grouping them into a single comment.`,
// `You should lean toward using a smaller number of these comments rather than rewriting it for every function if all of them are unchanged.`,
`You may do this for imports as well if needed.`,
`Do not explain your changes either before or after the code block.`,
];
function claude35SonnetLazyApplyPrompt(
...args: Parameters<LazyApplyPrompt>
): ReturnType<LazyApplyPrompt> {
@ -23,9 +32,8 @@ function claude35SonnetLazyApplyPrompt(
${args[2]}
\`\`\`
Above is a code block containing the original version of a file (ORIGINAL CODE) and below it is a code snippet (NEW CODE) that was suggested as modification to the original file.
Your task is to apply the NEW CODE to the ORIGINAL CODE and show what the entire file would look like after it is applied. Your response should be a code block containing a new version of the entire file. Whenever any part of the code is the same as before, you may simply indicate this with a comment that says "${UNCHANGED_CODE}" instead of rewriting. You may do this for imports as well if needed. Do not explain your changes either before or after the code block.
Above is a code block containing the original version of a file (ORIGINAL CODE) and below it is a code snippet (NEW CODE) that was suggested as modification to the original file. Your task is to apply the NEW CODE to the ORIGINAL CODE and show what the entire file would look like after it is applied.
- ${RULES.join("\n- ")}
`;
const assistantContent = dedent`