Skip to content

Commit

Permalink
Added skip fragmented responses ↞ [auto-sync from `adamlui/ai-apps/br…
Browse files Browse the repository at this point in the history
…avegpt`]
  • Loading branch information
kudo-sync-bot committed Oct 17, 2024
1 parent 6439325 commit 3d5736d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chatgpt/bravegpt/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.10.17.1
// @version 2024.10.17.2
// @license MIT
// @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287
// @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287
Expand Down Expand Up @@ -3193,7 +3193,7 @@
chunk = extractedChunks.join('')
}
accumulatedChunks = apis[caller.api].accumulatesText ? chunk : accumulatedChunks + chunk
if (accumulatedChunks.startsWith('{')) api.tryNew(caller)
if (/^(?:{|event:)/.test(accumulatedChunks)) api.tryNew(caller)
else {
try { // to show stream text
let textToShow = ''
Expand Down Expand Up @@ -3284,7 +3284,7 @@
if (caller.status != 'done') {
log.debug('Response text', respText)
const failMatch = failFlagsAndURLs.exec(respText)
if (failMatch || respText.startsWith('{')) {
if (failMatch || /^(?:{|event:)/.test(respText) {
if (failMatch) log.error('Fail flag detected', `'${failMatch[0]}'`)
api.tryNew(caller)
} else {
Expand Down

0 comments on commit 3d5736d

Please sign in to comment.