Skip to content

Commit 653314f

Browse files
committed
Merged done signal check for parsable APIs using new respPatterns.done
1 parent 44cfb86 commit 653314f

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.1.26.3
6+
// @version 2025.1.26.4
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -2665,16 +2665,15 @@
26652665
else { // AI response
26662666
apis.GPTforLove.parentID = chunkObjs[0].id || null // for contextual replies
26672667
chunkObjs.forEach(obj => replyChunk += obj.delta || '') // accumulate AI reply text
2668-
if (respChunk.includes('"finish_reason":"stop"')) isDone = true
26692668
}
26702669
} else if (callerAPI == 'MixerBox AI') { // extract/normalize AI reply data
26712670
replyChunk = [...respChunk.matchAll(/data:(.*)/g)] // arrayify data
26722671
.filter(match => !/message_(?:start|end)|done/.test(match)) // exclude signals
26732672
.map(match => // normalize whitespace
26742673
match[1].replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n'))
26752674
.join('') // stringify AI reply text
2676-
if (/data:(?:message_end|done)/.test(respChunk)) isDone = true
26772675
} textToShow += replyChunk
2676+
if (new RegExp(apis[callerAPI].respPatterns?.done).test(respChunk)) isDone = true
26782677
}
26792678

26802679
// Show accumulated reply chunks

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.26.3
151+
// @version 2025.1.26.4
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -3415,16 +3415,15 @@
34153415
else { // AI response
34163416
apis.GPTforLove.parentID = chunkObjs[0].id || null // for contextual replies
34173417
chunkObjs.forEach(obj => replyChunk += obj.delta || '') // accumulate AI reply text
3418-
if (respChunk.includes('"finish_reason":"stop"')) isDone = true
34193418
}
34203419
} else if (callerAPI == 'MixerBox AI') { // extract/normalize AI reply data
34213420
replyChunk = [...respChunk.matchAll(/data:(.*)/g)] // arrayify data
34223421
.filter(match => !/message_(?:start|end)|done/.test(match)) // exclude signals
34233422
.map(match => // normalize whitespace
34243423
match[1].replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n'))
34253424
.join('') // stringify AI reply text
3426-
if (/data:(?:message_end|done)/.test(respChunk)) isDone = true
34273425
} textToShow += replyChunk
3426+
if (new RegExp(apis[callerAPI].respPatterns?.done).test(respChunk)) isDone = true
34283427
}
34293428

34303429
// Show accumulated reply chunks

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.26.3
151+
// @version 2025.1.26.4
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -3299,16 +3299,15 @@
32993299
else { // AI response
33003300
apis.GPTforLove.parentID = chunkObjs[0].id || null // for contextual replies
33013301
chunkObjs.forEach(obj => replyChunk += obj.delta || '') // accumulate AI reply text
3302-
if (respChunk.includes('"finish_reason":"stop"')) isDone = true
33033302
}
33043303
} else if (callerAPI == 'MixerBox AI') { // extract/normalize AI reply data
33053304
replyChunk = [...respChunk.matchAll(/data:(.*)/g)] // arrayify data
33063305
.filter(match => !/message_(?:start|end)|done/.test(match)) // exclude signals
33073306
.map(match => // normalize whitespace
33083307
match[1].replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n'))
33093308
.join('') // stringify AI reply text
3310-
if (/data:(?:message_end|done)/.test(respChunk)) isDone = true
33113309
} textToShow += replyChunk
3310+
if (new RegExp(apis[callerAPI].respPatterns?.done).test(respChunk)) isDone = true
33123311
}
33133312

33143313
// Show accumulated reply chunks

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.1.26.3
152+
// @version 2025.1.26.4
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -3596,16 +3596,15 @@
35963596
else { // AI response
35973597
apis.GPTforLove.parentID = chunkObjs[0].id || null // for contextual replies
35983598
chunkObjs.forEach(obj => replyChunk += obj.delta || '') // accumulate AI reply text
3599-
if (respChunk.includes('"finish_reason":"stop"')) isDone = true
36003599
}
36013600
} else if (callerAPI == 'MixerBox AI') { // extract/normalize AI reply data
36023601
replyChunk = [...respChunk.matchAll(/data:(.*)/g)] // arrayify data
36033602
.filter(match => !/message_(?:start|end)|done/.test(match)) // exclude signals
36043603
.map(match => // normalize whitespace
36053604
match[1].replace(/\[SPACE\]/g, ' ').replace(/\[NEWLINE\]/g, '\n'))
36063605
.join('') // stringify AI reply text
3607-
if (/data:(?:message_end|done)/.test(respChunk)) isDone = true
36083606
} textToShow += replyChunk
3607+
if (new RegExp(apis[callerAPI].respPatterns?.done).test(respChunk)) isDone = true
36093608
}
36103609

36113610
// Show accumulated reply chunks

0 commit comments

Comments
 (0)