Created
June 26, 2024 06:51
-
-
Save JKamsker/6ab92d617b52a878c41796571b161ecd to your computer and use it in GitHub Desktop.
OpenAI Chat GPT-4o enforce
This file contains hidden or 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 OpenAI Chat GPT-4o enforce | |
// @version 1 | |
// @grant none | |
// @description This script enforces the GPT-4o model on the OpenAI Chat website | |
// @match https://chatgpt.com/* | |
// @run-at document-end | |
// ==/UserScript== | |
(function() { | |
// Store a reference to the original JSON.stringify function | |
const originalStringify = JSON.stringify; | |
// Override JSON.stringify | |
JSON.stringify = function(data, ...args) { | |
if(isChatMessage(data)) { | |
data.model = 'gpt-4o'; | |
} | |
// Call the original JSON.stringify function | |
return originalStringify.apply(JSON, [data, ...args]); | |
}; | |
})(); | |
function isChatMessage(data) { | |
return data.action === 'next' && data.messages && data.messages.length > 0 && data.model; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment