mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Revert "Fixed issue where messages where not showing correctly. This commit should be 100% backward compatible with the previous implementation of the chat history assuming no edits."
This reverts commit ec4274c6
This commit is contained in:
@@ -36,32 +36,6 @@
|
|||||||
updating = true;
|
updating = true;
|
||||||
|
|
||||||
// Send API request
|
// Send API request
|
||||||
/*
|
|
||||||
await fetchEventSource("https://api.openai.com/v1/chat/completions", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
Authorization:
|
|
||||||
`Bearer ${$apiKeyStorage}`,
|
|
||||||
"Content-Type": "text/event-stream",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
model: "gpt-3.5-turbo",
|
|
||||||
messages, // Provide the previous messages as well for context
|
|
||||||
// temperature: 1
|
|
||||||
// top_p: 1
|
|
||||||
// n: 1
|
|
||||||
stream: false,
|
|
||||||
// stop: null
|
|
||||||
max_tokens: 4096,
|
|
||||||
}),
|
|
||||||
onmessage(ev) {
|
|
||||||
console.log(ev);
|
|
||||||
},
|
|
||||||
onerror(err) {
|
|
||||||
throw err;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
const response: Response = await (
|
const response: Response = await (
|
||||||
await fetch("https://api.openai.com/v1/chat/completions", {
|
await fetch("https://api.openai.com/v1/chat/completions", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user