to:sync
This commit is contained in:
parent
f7d1730c8f
commit
9b2676e8a0
@ -184,14 +184,14 @@
|
||||
}
|
||||
|
||||
// 历史消息
|
||||
const messagesList = [];
|
||||
// const messagesList = [];
|
||||
|
||||
// 调用api
|
||||
function chatApi(msg) {
|
||||
slideBottom();
|
||||
|
||||
messagesList.push({role: "user", content: msg});
|
||||
const body = JSON.stringify({model: "google/gemma-7b-it:free", messages: messagesList});
|
||||
// messagesList.push({role: "user", content: msg});
|
||||
const body = JSON.stringify({model: "google/gemma-7b-it:free", messages: [{role: "user", content: msg}]});
|
||||
// alert(body)
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
@ -254,7 +254,7 @@
|
||||
});
|
||||
// 回车监听事件
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
if (event.key === 'Enter') {
|
||||
console.log(focus);
|
||||
if (focus) {
|
||||
submit.click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user