From 2582ffbccf2050153619efcca2a91ecae7c3a8ff Mon Sep 17 00:00:00 2001 From: root Date: Wed, 20 May 2026 23:10:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=B5=20D107=20=C2=B7=20=E5=8E=BB?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=8F=90=E7=A4=BA=E8=AF=8D+=E5=8F=8C?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E9=80=9A=E9=81=93+=E6=96=B0=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=8C=89=E9=92=AE+=E7=BD=91=E6=98=93=E4=BA=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homepage/index.html | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/homepage/index.html b/homepage/index.html index 35469a8..30da15a 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -482,6 +482,7 @@ table.tool-table td:last-child{text-align:right}
霜砚 对话
+
@@ -606,7 +607,9 @@ let currentEngine = 'deepseek'; let isStreaming = false; let isTempUser = false; let tempCode = ''; -let chatHistory = []; +let syHistory = []; let zyHistory = []; +function getH(){return currentPersona=="zhuyuan"?zyHistory:syHistory} +function clrH(){if(currentPersona=="zhuyuan")zyHistory=[];else syHistory=[]} // ===== 人格体选择 ===== function selectPersona(p) { @@ -653,6 +656,13 @@ function openChat() { setTimeout(() => document.getElementById('modal-input').focus(), 100); } +function newChat() { + clrH(); + const b = document.getElementById("modal-body"); + if(b) b.innerHTML = "
新对话已开始,选择人格体和引擎。
"; + document.getElementById("modal-status").textContent = "新对话"; +} + function closeChat() { const modal = document.getElementById('chat-modal'); modal.classList.remove('open'); @@ -666,7 +676,7 @@ async function modalSend() { if (!msg || isStreaming) return; input.value = ''; appendMsg('user', msg); - chatHistory.push({role:'user', content: msg}); + getH().push({role:'user', content: msg}); const body = document.getElementById('modal-body'); const hint = body.querySelector('.empty-hint'); @@ -702,7 +712,7 @@ async function modalSend() { persona: currentPersona, engine: currentEngine, message: msg, - history: chatHistory.slice(-60), + history: getH().slice(-60), user: user, isTemp: isTempUser }) @@ -761,7 +771,7 @@ async function modalSend() { document.getElementById('modal-send').disabled = false; if (fullText) { - chatHistory.push({role:'assistant', content: fullText}); + getH().push({role:'assistant', content: fullText}); } bubble.removeAttribute('id'); } @@ -960,4 +970,10 @@ async function sendMessage() { })(); + + +
+ +
+ \ No newline at end of file