Skip to content

Commit

Permalink
Eliminated unneeded fail flag check from OpenAI text processing ↞ [au…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Jan 26, 2025
1 parent 76c4d7e commit 25b8b77
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions greasemonkey/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 2025.1.26.9
// @version 2025.1.26.10
// @license MIT
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
Expand Down Expand Up @@ -3477,17 +3477,10 @@
: ['openAInotWorking', 'suggestProxy'] )
else api.tryNew(caller)
} else if (callerAPI == 'OpenAI' && resp.response) { // show response or return RQs from OpenAI
const failMatch = reFailFlags?.exec(resp.response)
if (failMatch) { // suggest proxy or try diff API
log.debug('Response text', resp.response) ; log.error('Fail flag detected', `'${failMatch[0]}'`)
if (caller == get.reply) appAlert('openAInotWorking', 'suggestProxy')
else api.tryNew(caller)
} else {
try { // to show response or return RQs
textToShow = JSON.parse(resp.response).choices[0].message.content
handleProcessCompletion()
} catch (err) { handleProcessError(err) }
}
try { // to show response or return RQs
textToShow = JSON.parse(resp.response).choices[0].message.content
handleProcessCompletion()
} catch (err) { handleProcessError(err) }
} else if (resp.responseText) { // show response or return RQs from proxy API
if (!apis[callerAPI].parsingRequired) { textToShow = resp.responseText ; handleProcessCompletion() }
else { // parse structured responseText
Expand Down

0 comments on commit 25b8b77

Please sign in to comment.