| 2516 | tryParseStreamingError(response, rawData); | 2516 | tryParseStreamingError(response, rawData); |
| 2517 | const parsed = JSON.parse(rawData); | 2517 | const parsed = JSON.parse(rawData); |
| 2518 | | 2518 | |
| 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-swipe | 2521 | // 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 }); |