Revert "Attempt at tree-like chat management"

This reverts commit e27cb0a9
This commit is contained in:
Michael Tanzer 2023-03-05 14:59:02 +00:00
parent 08db5da7db
commit bb9509aa64
1 changed files with 27 additions and 0 deletions

View File

@ -36,6 +36,33 @@
updating = true;
// 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 (
await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",