Skip to content

Commit

Permalink
Moved url init for GET reqs outside xhrConfig init in `get.reply(…
Browse files Browse the repository at this point in the history
…)` to align w/ `get.related()` code ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
  • Loading branch information
kudo-sync-bot committed Jan 19, 2025
1 parent 5db46b7 commit ef12d3c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chatgpt/duckduckgpt/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.18.3
// @version 2025.1.18.4
// @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 @@ -3193,10 +3193,11 @@
},
onload: resp => dataProcess.text(resp, { caller: get.reply, callerAPI: reqAPI }),
onloadstart: resp => dataProcess.stream(resp, { caller: get.reply, callerAPI: reqAPI }),
url: ( apis[reqAPI].endpoints?.completions || apis[reqAPI].endpoint )
+ ( reqMethod == 'GET' ? `?q=${encodeURIComponent(msgChain[msgChain.length -1].content)}` : '' )
url: apis[reqAPI].endpoints?.completions || apis[reqAPI].endpoint
}
if (reqMethod == 'POST') xhrConfig.data = await api.createPayload(reqAPI, msgChain)
else if (reqMethod == 'GET')
xhrConfig.url += `?q=${encodeURIComponent(msgChain[msgChain.length -1].content)}`
xhr(xhrConfig)

// Get/show related queries if enabled on 1st get.reply()
Expand Down

0 comments on commit ef12d3c

Please sign in to comment.