Skip to content

Commit

Permalink
openaiExplainPatch: include model name
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Dec 8, 2023
1 parent 77eda59 commit 0e78575
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/openaiExplainPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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<!-- Generated by ${m} -->`;
}

0 comments on commit 0e78575

Please sign in to comment.