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) {
+ +
+ + +
+