From 2285755b34d9e4b7763fbd93e4f118faebdfa74f Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Sun, 26 Apr 2026 11:27:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B7=B1=E5=BA=A6?= =?UTF-8?q?=E6=80=9D=E8=80=83=E5=92=8C=E8=81=94=E7=BD=91=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E6=80=9D=E8=80=83?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B5=81=E5=BC=8F=E8=BE=93=E5=87=BA=E5=92=8C?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/app.js | 120 ++++++++++++++++++++++++++++++++++++++++++++++--- www/index.html | 6 +-- www/style.css | 96 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+), 9 deletions(-) diff --git a/www/app.js b/www/app.js index 395d19c..c56bc29 100644 --- a/www/app.js +++ b/www/app.js @@ -5,6 +5,7 @@ const CONFIG = { apiUrl: 'https://open.bigmodel.cn/api/paas/v4/chat/completions', apiKey: '2259e33a1357460abe17919aaf81e73d.K44a8LPQTmFM5PKm', model: 'glm-4.5-air', + thinkingModel: 'glm-4-flash-thinking', // 思考模型 maxTokens: 2048 }; @@ -13,6 +14,10 @@ let conversations = []; // 对话列表 let currentConversation = null; // 当前对话 let isLoading = false; +// 功能开关 +let enableThinking = false; // 深度思考 +let enableSearch = false; // 联网搜索 + // DOM 元素(初始为 null,在 openConversation 时重新获取) let appContainer = null; let messagesContainer = null; @@ -20,6 +25,8 @@ let messagesDiv = null; let userInput = null; let sendBtn = null; let welcome = null; +let thinkingBtn = null; +let searchBtn = null; // 初始化 document.addEventListener('DOMContentLoaded', () => { @@ -171,6 +178,18 @@ function openConversation(id) {
+ +
+ + +
+