Last active
June 10, 2024 02:18
-
-
Save altbdoor/ff538bc6b411583fdc500750e7faff04 to your computer and use it in GitHub Desktop.
Force ChatGPT to use GPT3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Force GPT3 | |
// @namespace altbdoor | |
// @match https://chatgpt.com/* | |
// @grant none | |
// @version 1.1 | |
// @author altbdoor | |
// @run-at document-start | |
// @updateURL https://gist.github.com/altbdoor/ff538bc6b411583fdc500750e7faff04/raw/force-gpt3.user.js | |
// @downloadURL https://gist.github.com/altbdoor/ff538bc6b411583fdc500750e7faff04/raw/force-gpt3.user.js | |
// @supportURL https://gist.github.com/altbdoor/ff538bc6b411583fdc500750e7faff04#new_comment_field | |
// ==/UserScript== | |
// https://blog.logrocket.com/intercepting-javascript-fetch-api-requests-responses/ | |
const originalFetch = unsafeWindow.fetch; | |
unsafeWindow.fetch = async (url, config) => { | |
if (url.includes("/backend-api/conversation") && config.method === "POST") { | |
try { | |
const body = JSON.parse(config.body); | |
config.body = JSON.stringify({ | |
...body, | |
model: "text-davinci-002-render-sha", | |
}); | |
} catch (error) { | |
console.error("Error parsing JSON body:", error); | |
} | |
} | |
const response = await originalFetch(url, config); | |
return response; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to https://github.com/altbdoor/userscripts/blob/master/force-gpt3.user.js