Don't split multiswipes unless requested (#4703)

2175ccbf1eb67758b78b6cd8fd1f6aa1a2687922

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +1 -1Ignore whitespace
public/scripts/openai.js+1 -1
@@ -2516,7 +2516,7 @@ async function sendOpenAIRequest(type, messages, signal, { jsonSchema = null } =
2516 tryParseStreamingError(response, rawData);2516 tryParseStreamingError(response, rawData);
2517 const parsed = JSON.parse(rawData);2517 const parsed = JSON.parse(rawData);
25182518
2519 if (Array.isArray(parsed?.choices) && parsed?.choices?.[0]?.index > 0) {2519 if (canMultiSwipe && Array.isArray(parsed?.choices) && parsed?.choices?.[0]?.index > 0) {
2520 const swipeIndex = parsed.choices[0].index - 1;2520 const swipeIndex = parsed.choices[0].index - 1;
2521 // FIXME: state.reasoning should be an array to support multi-swipe2521 // FIXME: state.reasoning should be an array to support multi-swipe
2522 swipes[swipeIndex] = (swipes[swipeIndex] || '') + getStreamingReply(parsed, state, { overrideShowThoughts: false });2522 swipes[swipeIndex] = (swipes[swipeIndex] || '') + getStreamingReply(parsed, state, { overrideShowThoughts: false });