Skip to content

Commit

Permalink
Update LLM.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MRIOikko authored Nov 1, 2024
1 parent 97f81ff commit 253ae1f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions LLM.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,16 @@ async function sendMessage() {
const options = {
method: 'POST',
headers: {
'x-rapidapi-key': '96fe58a1edmsh64abdfc6c6d56dap19fd5djsnd234de8c1a26',
'x-rapidapi-host': 'chat-gpt26.p.rapidapi.com',
'Content-Type': 'application/json'

},
body: JSON.stringify({
messages: [{ role: 'user', content: message }],
model: 'gpt-3.5-turbo'
model:
})
};


const response = await fetch('https://chat-gpt26.p.rapidapi.com/', options);
const response = await fetch(, options);
const data = await response.json();

const botResponse = data.choices[0].message.content;
Expand Down Expand Up @@ -203,4 +201,4 @@ function appendMessage(sender, message) {
chatElement.appendChild(messageElement);
chatLog.appendChild(chatElement);
chatLog.scrollTop = chatLog.scrollHeight;
}
}

0 comments on commit 253ae1f

Please sign in to comment.