Skip to content

Commit

Permalink
Refactored dataProcess.text() for readability ↞ [auto-sync from htt…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Jan 15, 2025
1 parent aab170f commit d342fc6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions greasemonkey/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.15.1
// @version 2025.1.15.2
// @license MIT
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
Expand Down Expand Up @@ -3700,9 +3700,9 @@
handleProcessCompletion()
} catch (err) { handleProcessError(err) }
}
} else if (resp.responseText) {
if (/AIchatOS|ToYaml|FREEGPT/.test(caller.api)) {
try { // to show response or return related queries
} else if (resp.responseText) { // show response or return related queries
if (/AIchatOS|FREEGPT|ToYaml/.test(caller.api)) {
try {
const text = resp.responseText, chunkSize = 1024
let currentIdx = 0
while (currentIdx < text.length) {
Expand All @@ -3712,14 +3712,14 @@
handleProcessCompletion()
} catch (err) { handleProcessError(err) }
} else if (caller.api == 'GPTforLove') {
try { // to show response or return related queries
try {
let chunks = resp.responseText.trim().split('\n'),
lastObj = JSON.parse(chunks[chunks.length - 1])
if (lastObj.id) apis.GPTforLove.parentID = lastObj.id
respText = lastObj.text ; handleProcessCompletion()
} catch (err) { handleProcessError(err) }
} else if (caller.api == 'MixerBox AI') {
try { // to show response or return related queries
try {
const extractedData = Array.from(resp.responseText.matchAll(/data:(.*)/g), match => match[1]
.replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n'))
.filter(match => !/message_(?:start|end)|done/.test(match))
Expand Down

0 comments on commit d342fc6

Please sign in to comment.