🎵 D107 · 去系统提示词+双独立通道+新对话按钮+网易云播放器
This commit is contained in:
parent
0f53854bd2
commit
2582ffbccf
@ -482,6 +482,7 @@ table.tool-table td:last-child{text-align:right}
|
|||||||
<span id="modal-p-icon" style="font-size:22px">❄</span>
|
<span id="modal-p-icon" style="font-size:22px">❄</span>
|
||||||
<div class="info">与 <strong id="modal-p-name">霜砚</strong> 对话</div>
|
<div class="info">与 <strong id="modal-p-name">霜砚</strong> 对话</div>
|
||||||
</div>
|
</div>
|
||||||
|
<button class="chat-modal-close" onclick="newChat()">✦</button>
|
||||||
<button class="chat-modal-close" onclick="closeChat()">✕</button>
|
<button class="chat-modal-close" onclick="closeChat()">✕</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-engine-row">
|
<div class="chat-engine-row">
|
||||||
@ -606,7 +607,9 @@ let currentEngine = 'deepseek';
|
|||||||
let isStreaming = false;
|
let isStreaming = false;
|
||||||
let isTempUser = false;
|
let isTempUser = false;
|
||||||
let tempCode = '';
|
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) {
|
function selectPersona(p) {
|
||||||
@ -653,6 +656,13 @@ function openChat() {
|
|||||||
setTimeout(() => document.getElementById('modal-input').focus(), 100);
|
setTimeout(() => document.getElementById('modal-input').focus(), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function newChat() {
|
||||||
|
clrH();
|
||||||
|
const b = document.getElementById("modal-body");
|
||||||
|
if(b) b.innerHTML = "<div class='\''empty-hint'\''>新对话已开始,选择人格体和引擎。</div>";
|
||||||
|
document.getElementById("modal-status").textContent = "新对话";
|
||||||
|
}
|
||||||
|
|
||||||
function closeChat() {
|
function closeChat() {
|
||||||
const modal = document.getElementById('chat-modal');
|
const modal = document.getElementById('chat-modal');
|
||||||
modal.classList.remove('open');
|
modal.classList.remove('open');
|
||||||
@ -666,7 +676,7 @@ async function modalSend() {
|
|||||||
if (!msg || isStreaming) return;
|
if (!msg || isStreaming) return;
|
||||||
input.value = '';
|
input.value = '';
|
||||||
appendMsg('user', msg);
|
appendMsg('user', msg);
|
||||||
chatHistory.push({role:'user', content: msg});
|
getH().push({role:'user', content: msg});
|
||||||
|
|
||||||
const body = document.getElementById('modal-body');
|
const body = document.getElementById('modal-body');
|
||||||
const hint = body.querySelector('.empty-hint');
|
const hint = body.querySelector('.empty-hint');
|
||||||
@ -702,7 +712,7 @@ async function modalSend() {
|
|||||||
persona: currentPersona,
|
persona: currentPersona,
|
||||||
engine: currentEngine,
|
engine: currentEngine,
|
||||||
message: msg,
|
message: msg,
|
||||||
history: chatHistory.slice(-60),
|
history: getH().slice(-60),
|
||||||
user: user,
|
user: user,
|
||||||
isTemp: isTempUser
|
isTemp: isTempUser
|
||||||
})
|
})
|
||||||
@ -761,7 +771,7 @@ async function modalSend() {
|
|||||||
document.getElementById('modal-send').disabled = false;
|
document.getElementById('modal-send').disabled = false;
|
||||||
|
|
||||||
if (fullText) {
|
if (fullText) {
|
||||||
chatHistory.push({role:'assistant', content: fullText});
|
getH().push({role:'assistant', content: fullText});
|
||||||
}
|
}
|
||||||
bubble.removeAttribute('id');
|
bubble.removeAttribute('id');
|
||||||
}
|
}
|
||||||
@ -960,4 +970,10 @@ async function sendMessage() {
|
|||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
<!-- Music Player -->
|
||||||
|
<div style="position:fixed;bottom:20px;right:20px;z-index:40;border-radius:12px;overflow:hidden;box-shadow:0 4px 20px rgba(0,0,0,.4);opacity:.65;transition:opacity .3s" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=.65">
|
||||||
|
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=350 height=80 src="//music.163.com/outchain/player?type=0&id=3778678&auto=1&height=66"></iframe>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user