Skip to content

Commit

Permalink
Minor (debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnd0e committed Dec 26, 2024
1 parent ef6e6e7 commit 1c4bd50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ async function toOpenAiStream (chunk, controller) {
}));
data = { candidates };
}
const cand = data.candidates[0]; // !!untested with candidateCount>1
const cand = data.candidates[0];
console.assert(data.candidates.length === 1, "Unexpected candidates count: %d", data.candidates.length);
cand.index = cand.index || 0; // absent in new -002 models response
if (!this.last[cand.index]) {
controller.enqueue(transform(data, false, "first"));
Expand Down

0 comments on commit 1c4bd50

Please sign in to comment.