Skip to content

Instantly share code, notes, and snippets.

@altbdoor
Last active June 10, 2024 02:18
Show Gist options
  • Save altbdoor/ff538bc6b411583fdc500750e7faff04 to your computer and use it in GitHub Desktop.
Save altbdoor/ff538bc6b411583fdc500750e7faff04 to your computer and use it in GitHub Desktop.
Force ChatGPT to use GPT3
// ==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;
};
@altbdoor
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment