Skip to content

Commit

Permalink
Added Dev Mode log of final reqData to api.createReqData()
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jan 26, 2025
1 parent 138ee49 commit e59b7a2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions amazongpt/greasemonkey/amazongpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Adds the magic of AI to Amazon shopping
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.6
// @version 2025.1.26.7
// @license MIT
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
Expand Down Expand Up @@ -2505,6 +2505,7 @@
},

async createReqData(api, msgs) { // returns payload for POST / query string for GET
log.caller = `api.createReqData('${api}', msgs)`
msgs = structuredClone(msgs) // avoid mutating global msgChain
const time = Date.now(), lastUserMsg = msgs[msgs.length - 1]
lastUserMsg.content = prompts.augment(lastUserMsg.content, { api: api })
Expand All @@ -2527,7 +2528,7 @@
: apis[api].method == 'GET' ? encodeURIComponent(lastUserMsg.content) : null
if (api == 'GPTforLove' && apis.GPTforLove.parentID) // include parentID for contextual replies
reqData.options = { parentMessageId: apis.GPTforLove.parentID }
return reqData
log.dev(reqData) ; return reqData
},

pick(caller) {
Expand Down
5 changes: 3 additions & 2 deletions bravegpt/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.6
// @version 2025.1.26.7
// @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 @@ -3202,6 +3202,7 @@
},

async createReqData(api, msgs) { // returns payload for POST / query string for GET
log.caller = `api.createReqData('${api}', msgs)`
msgs = structuredClone(msgs) // avoid mutating global msgChain
const time = Date.now(), lastUserMsg = msgs[msgs.length - 1]
lastUserMsg.content = prompts.augment(lastUserMsg.content, { api: api })
Expand All @@ -3224,7 +3225,7 @@
: apis[api].method == 'GET' ? encodeURIComponent(lastUserMsg.content) : null
if (api == 'GPTforLove' && apis.GPTforLove.parentID) // include parentID for contextual replies
reqData.options = { parentMessageId: apis.GPTforLove.parentID }
return reqData
log.dev(reqData) ; return reqData
},

pick(caller) {
Expand Down
5 changes: 3 additions & 2 deletions duckduckgpt/greasemonkey/duckduckgpt.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-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.6
// @version 2025.1.26.7
// @license MIT
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
Expand Down Expand Up @@ -3088,6 +3088,7 @@
},

async createReqData(api, msgs) { // returns payload for POST / query string for GET
log.caller = `api.createReqData('${api}', msgs)`
msgs = structuredClone(msgs) // avoid mutating global msgChain
const time = Date.now(), lastUserMsg = msgs[msgs.length - 1]
lastUserMsg.content = prompts.augment(lastUserMsg.content, { api: api })
Expand All @@ -3110,7 +3111,7 @@
: apis[api].method == 'GET' ? encodeURIComponent(lastUserMsg.content) : null
if (api == 'GPTforLove' && apis.GPTforLove.parentID) // include parentID for contextual replies
reqData.options = { parentMessageId: apis.GPTforLove.parentID }
return reqData
log.dev(reqData) ; return reqData
},

pick(caller) {
Expand Down
5 changes: 3 additions & 2 deletions googlegpt/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.26.6
// @version 2025.1.26.7
// @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 @@ -3383,6 +3383,7 @@
},

async createReqData(api, msgs) { // returns payload for POST / query string for GET
log.caller = `api.createReqData('${api}', msgs)`
msgs = structuredClone(msgs) // avoid mutating global msgChain
const time = Date.now(), lastUserMsg = msgs[msgs.length - 1]
lastUserMsg.content = prompts.augment(lastUserMsg.content, { api: api })
Expand All @@ -3405,7 +3406,7 @@
: apis[api].method == 'GET' ? encodeURIComponent(lastUserMsg.content) : null
if (api == 'GPTforLove' && apis.GPTforLove.parentID) // include parentID for contextual replies
reqData.options = { parentMessageId: apis.GPTforLove.parentID }
return reqData
log.dev(reqData) ; return reqData
},

pick(caller) {
Expand Down

0 comments on commit e59b7a2

Please sign in to comment.