diff --git a/core/indexing/types.ts b/core/indexing/types.ts index 91111dc05..3e3e287b6 100644 --- a/core/indexing/types.ts +++ b/core/indexing/types.ts @@ -5,7 +5,7 @@ export enum IndexResultType { Delete = "del", AddTag = "addTag", RemoveTag = "removeTag", - UpdateLastUpdated = "updateLastUpdated" + UpdateLastUpdated = "updateLastUpdated", } export type MarkCompleteCallback = ( diff --git a/core/llm/templates/edit.ts b/core/llm/templates/edit.ts index 00a05ac72..9be515993 100644 --- a/core/llm/templates/edit.ts +++ b/core/llm/templates/edit.ts @@ -25,9 +25,11 @@ const gptEditPrompt: PromptTemplate = (_, otherData) => { ${otherData.prefix}[BLANK]${otherData.codeToEdit}${otherData.suffix} \`\`\` -Given the user's request: "${otherData.userInput}" +Above is the file of code that the user is currently editing in. Their cursor is located at the "[BLANK]". They have requested that you fill in the "[BLANK]" with code that satisfies the following request: -Here is the code that should fill in the [BLANK]:`; +"${otherData.userInput}" + +Please generate this code. Your output will be only the code that should replace the "[BLANK]", without repeating any of the prefix or suffix, without any natural language explanation, and without messing up indentation. Here is the code that will replace the "[BLANK]":`; } const paragraphs = [ @@ -74,7 +76,7 @@ const osModelsEditPrompt: PromptTemplate = (history, otherData) => { !firstCharOfFirstLine; const suffixTag = isSuffix ? "" : ""; const suffixExplanation = isSuffix - ? " When you get to \"\", end your response." + ? ' When you get to "", end your response.' : ""; // If neither prefilling nor /v1/completions are supported, we have to use a chat prompt without putting words in the model's mouth