diff --git a/static/ai-chat1.html b/static/ai-chat1.html
index 07917ca..af1a0a1 100644
--- a/static/ai-chat1.html
+++ b/static/ai-chat1.html
@@ -234,9 +234,9 @@
// 初始化
function init() {
addAIMessage("你好,请输入你想问的问题。");
- var submit = $("#submit");
- var userInput = $("#user-input");
- var focus = false;
+ let submit = $("#submit");
+ let userInput = $("#user-input");
+ let focus = false;
// 监听输入框焦点
userInput.focus(function () {
focus = true;
diff --git a/static/index_ollama.html b/static/index_ollama.html
index 529a57c..6acf1e5 100644
--- a/static/index_ollama.html
+++ b/static/index_ollama.html
@@ -48,30 +48,30 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/js/api.js b/static/js/api.js
index 5d23892..fc540ed 100644
--- a/static/js/api.js
+++ b/static/js/api.js
@@ -58,9 +58,10 @@ function setSystemPrompt(){
async function getModels(){
- const response = await fetch(`${ollama_host}/api/tags`);
- const data = await response.json();
- return data;
+ // const response = await fetch(`${ollama_host}/api/tags`);
+ // const data = await response.json();
+ // return data;
+ return undefined;
}
@@ -68,8 +69,8 @@ async function getModels(){
function postRequest(data, signal) {
// const URL = `${ollama_host}/api/generate`;
const URL = `https://openrouter.ai/api/v1/chat/completions`;
- const body = JSON.stringify({model: "google/gemma-7b-it:free", messages: [{role: "user", content: data}]});
- alert(body);
+ const body = JSON.stringify({model: "google/gemma-7b-it:free", messages: [{role: "user", content: data.prompt}]});
+ // alert(body)
return fetch(URL, {
method: 'POST',
headers: {
diff --git a/static/js/chat.js b/static/js/chat.js
index 73d8842..7e5fb5c 100644
--- a/static/js/chat.js
+++ b/static/js/chat.js
@@ -13,7 +13,6 @@ Also see: https://github.com/jmorganca/ollama/blob/main/docs/faq.md
`;
-
const clipboardIcon = `