Skip to content

Commit

Permalink
fix(openai.js): trim snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonictw committed Jun 16, 2024
1 parent 57d1167 commit 7287ce4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clients/openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ function sliceContent(content, maxLength, separator="\n") {
lastSnippet += text;
continue;
}
snippets.push(lastSnippet);
snippets.push(lastSnippet.trim());
lastSnippet = "";
}
if (lastSnippet) {
snippets.push(lastSnippet);
snippets.push(lastSnippet.trim());
}

return snippets;
Expand Down

0 comments on commit 7287ce4

Please sign in to comment.