Last active
February 7, 2024 18:57
-
-
Save f/74cce4ca775dc4f3a78a30e2ad6ede84 to your computer and use it in GitHub Desktop.
create custom chatgpt conversation
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
// thanks to x.com/umutbasalt | |
function generateUUID() { | |
function r() { | |
return Math.floor(Math.random() * 65536).toString(16).padStart(4, '0'); | |
} | |
return ( | |
r() + r() + "-" + | |
r() + "-" + | |
r() + "-" + | |
r() + "-" + | |
r() + r() + r() | |
); | |
} | |
const data = { | |
"action": "next", | |
"messages": [ | |
{ | |
"id": generateUUID(), | |
"author": { | |
"role": "user" | |
}, | |
"content": { | |
"content_type": "text", | |
"parts": [ | |
"selam naber" | |
] | |
}, | |
"metadata": {} | |
}, | |
{ | |
"id": generateUUID(), | |
"author": { | |
"role": "assistant" | |
}, | |
"content": { | |
"content_type": "text", | |
"parts": [ | |
"akıllı ol lan." | |
] | |
}, | |
"metadata": {} | |
}, | |
{ | |
"id": generateUUID(), | |
"author": { | |
"role": "user" | |
}, | |
"content": { | |
"content_type": "text", | |
"parts": [ | |
"tamam abi." | |
] | |
}, | |
"metadata": {} | |
} | |
], | |
"parent_message_id": generateUUID(), | |
"model": "text-davinci-002-render-sha", | |
"timezone_offset_min": -180, | |
"suggestions": [], | |
"history_and_training_disabled": false, | |
"arkose_token": null, | |
"conversation_mode": { | |
"kind": "primary_assistant" | |
}, | |
"force_paragen": false, | |
"force_rate_limit": false | |
} | |
await fetch("https://chat.openai.com/backend-api/conversation", { | |
"headers": { | |
"accept": "text/event-stream", | |
"accept-language": "en-US", | |
"authorization": "Bearer <token>", | |
"cache-control": "no-cache", | |
"content-type": "application/json", | |
"pragma": "no-cache", | |
"sec-ch-ua": "\"Chromium\";v=\"121\", \"Not A(Brand\";v=\"99\"", | |
"sec-ch-ua-mobile": "?0", | |
"sec-ch-ua-platform": "\"macOS\"", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-origin", | |
}, | |
"referrer": "https://chat.openai.com/", | |
"referrerPolicy": "strict-origin-when-cross-origin", | |
"body": JSON.stringify(data), | |
"method": "POST", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like they've fixed this "fake conversation history" issue hence new conversation ids don't work anymore.
Example: https://chat.openai.com/share/1a291020-dcf1-463a-a20c-b65d9dc49312