Skip to content

Commit

Permalink
fix gemini edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
xqdoo00o committed Jun 2, 2024
1 parent d632885 commit e338237
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8211,6 +8211,12 @@
let endIdx = value.lastIndexOf("}");
payload = JSON.parse(value.slice(startIdx, endIdx + 1));
} catch (e) {
if (value === "]") {
if (existVoice && enableAutoVoice && currentVoiceIdx === autoVoiceDataIdx) {
let voiceText = longReplyFlag ? "" : progressData.slice(autoVoiceIdx);
autoSpeechEvent(voiceText, currentResEle, false, true);
}
}
return readChunk();
}
let content = payload.candidates[0].content.parts[0].text;
Expand Down

0 comments on commit e338237

Please sign in to comment.