diff --git a/src/openaiExplainPatch.js b/src/openaiExplainPatch.js index b34acd7..294febc 100644 --- a/src/openaiExplainPatch.js +++ b/src/openaiExplainPatch.js @@ -116,9 +116,11 @@ Desired format: console.log(`user_prompt:\n\n${user_prompt}`); } + let m = null; + for (let i = 0; i < realModels.length; i++) try { - let m = realModels[i]; + m = realModels[i]; let enc = encoding_for_model(m); if (enc.encode(patchBody).length < amplification*max_tokens) throw new Error("The patch is trivial, no need for a summarization"); @@ -154,5 +156,5 @@ Desired format: console.log(aiResponse.choices[0].message); } - return aiResponse.choices[0].message.content; + return aiResponse.choices[0].message.content+`\n\n`; }