预设兼容:按真实抓包对齐装配与包装层,补上声明式工具与预设正则。
- 装配只认 prompt_order.enabled;squash_system_messages 只合并相邻 system(新增 system 档,连接符按酒馆用单换行)
- 包装层:new_chat_prompt、示例对话(new_example_chat_prompt + <START> 切段 + name)、角色卡三块与 personality_format/scenario_format、{{user}}/{{char}} 取值、任务契约并进预设条目
- 工具协议:按 ToolBindings / 伪工具协议数据声明真 tools(presetToolPolicy=preset),工具描述用到的条目不再重复作为消息发出
- 正则:promptOnly 作用于对话历史(含 depth 过滤)、写入时脚本改写回复;{{//}} 注释按配平扫描
- tools/st-request-diff:真假上游抓包对比工具、三份预设的机制结论与实测报告
This commit is contained in:
+131
-7
@@ -45,9 +45,32 @@
|
||||
<p class="chat-rail-note">
|
||||
未选存档即为快速对话(浏览器缓存,最多 2 条),可保存为持久会话。
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="chat-rail-toggle chat-rail-toggle-left"
|
||||
id="btn-hide-left"
|
||||
title="收起对话列表"
|
||||
aria-label="收起对话列表"
|
||||
>‹</button>
|
||||
</aside>
|
||||
|
||||
<main class="chat-main" id="chat-main">
|
||||
<button
|
||||
type="button"
|
||||
class="chat-rail-reopen chat-rail-reopen-left"
|
||||
id="btn-show-left"
|
||||
title="展开对话列表"
|
||||
aria-label="展开对话列表"
|
||||
hidden
|
||||
>›</button>
|
||||
<button
|
||||
type="button"
|
||||
class="chat-rail-reopen chat-rail-reopen-right"
|
||||
id="btn-show-right"
|
||||
title="展开上下文"
|
||||
aria-label="展开上下文"
|
||||
hidden
|
||||
>‹</button>
|
||||
<section class="chat-room" id="chat-room">
|
||||
<p class="chat-temp-mark" id="chat-temp-mark" hidden>临时会话</p>
|
||||
<div class="chat-arena" id="chat-arena" aria-live="polite" aria-label="模型竞技场"></div>
|
||||
@@ -87,10 +110,40 @@
|
||||
</main>
|
||||
|
||||
<aside class="chat-context" id="chat-context" aria-label="上下文配置">
|
||||
<button
|
||||
type="button"
|
||||
class="chat-rail-toggle chat-rail-toggle-right"
|
||||
id="btn-hide-right"
|
||||
title="收起上下文"
|
||||
aria-label="收起上下文"
|
||||
>›</button>
|
||||
<header class="chat-context-head">
|
||||
<h2>上下文</h2>
|
||||
<p class="chat-context-sub" id="context-sub">选择或新建后编辑</p>
|
||||
</header>
|
||||
<div class="chat-context-tabs" role="tablist" aria-label="上下文面板">
|
||||
<button
|
||||
type="button"
|
||||
class="chat-context-tab is-active"
|
||||
id="tab-shell"
|
||||
data-context-tab="shell"
|
||||
role="tab"
|
||||
aria-selected="true"
|
||||
aria-controls="shell-editor"
|
||||
>
|
||||
上下文
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="chat-context-tab"
|
||||
id="tab-keep"
|
||||
data-context-tab="keep"
|
||||
role="tab"
|
||||
aria-selected="false"
|
||||
aria-controls="keep-stats"
|
||||
>
|
||||
保留统计
|
||||
</button>
|
||||
</div>
|
||||
<div class="chat-shell-editor" id="shell-editor">
|
||||
<label>
|
||||
名称
|
||||
@@ -126,12 +179,58 @@
|
||||
尾注
|
||||
<textarea id="shell-post-turn" rows="2" disabled></textarea>
|
||||
</label>
|
||||
<label>
|
||||
角色名(对应预设里的 {{char}})
|
||||
<input type="text" id="shell-char-name" placeholder="空则用「作品」" disabled />
|
||||
</label>
|
||||
<label>
|
||||
角色描述(酒馆 Char Description 洞)
|
||||
<textarea
|
||||
id="shell-char-desc"
|
||||
rows="3"
|
||||
placeholder="空则这一条不发"
|
||||
disabled
|
||||
></textarea>
|
||||
</label>
|
||||
<label>
|
||||
角色性格(酒馆 Char Personality 洞,会套预设的性格模板)
|
||||
<textarea id="shell-char-pers" rows="2" disabled></textarea>
|
||||
</label>
|
||||
<label>
|
||||
场景(酒馆 Scenario 洞,会套预设的场景模板)
|
||||
<textarea id="shell-scenario" rows="2" disabled></textarea>
|
||||
</label>
|
||||
<label>
|
||||
示例对话(酒馆 mes_example 格式,用 <START> 分块)
|
||||
<textarea
|
||||
id="shell-examples"
|
||||
rows="3"
|
||||
placeholder="例:<START> {{user}}: 你好 {{char}}: 你也好"
|
||||
disabled
|
||||
></textarea>
|
||||
</label>
|
||||
<div class="chat-shell-editor-actions">
|
||||
<button
|
||||
type="button"
|
||||
class="st-btn"
|
||||
id="btn-clear-shell"
|
||||
disabled
|
||||
title="清空提示和设定,保留名称与已选模型"
|
||||
>
|
||||
清空
|
||||
</button>
|
||||
<button type="button" class="st-btn st-btn-primary" id="btn-save-shell" disabled>
|
||||
应用
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-keep-stats" id="keep-stats" role="tabpanel" aria-labelledby="tab-keep" hidden>
|
||||
<p class="chat-keep-stats-hint" id="keep-stats-hint"></p>
|
||||
<div class="chat-keep-stats-list" id="keep-stats-list"></div>
|
||||
<div class="chat-keep-stats-foot">
|
||||
<button type="button" class="st-btn" id="btn-clear-keep" hidden>清空统计</button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
@@ -153,17 +252,42 @@
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
<dialog class="chat-dialog" id="dialog-new-conv">
|
||||
<form method="dialog" id="form-new-conv">
|
||||
<h3>新建会话</h3>
|
||||
<p class="chat-dialog-hint">勾选要同时回复的模型,可以多选。未勾选也能创建,之后再加。</p>
|
||||
<label>
|
||||
会话名称
|
||||
<input type="text" id="new-conv-name" value="新会话" required />
|
||||
</label>
|
||||
<fieldset class="chat-model-pick">
|
||||
<legend>模型</legend>
|
||||
<div class="chat-compare-list" id="new-conv-models"></div>
|
||||
<p class="chat-dialog-hint" id="new-conv-models-empty" hidden>
|
||||
没有带 Key 的 API 配置。请先到设置里添加。
|
||||
</p>
|
||||
</fieldset>
|
||||
<div class="chat-dialog-actions">
|
||||
<button type="submit" class="st-btn st-btn-primary" value="ok">创建</button>
|
||||
<button type="submit" class="st-btn" value="cancel" formnovalidate>取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
<dialog class="chat-dialog" id="dialog-add-window">
|
||||
<form method="dialog" id="form-add-window">
|
||||
<h3>新增窗口</h3>
|
||||
<p class="chat-dialog-hint">选一个 API 配置,新增对照模型;发送时各模型同时回复。</p>
|
||||
<label>
|
||||
模型配置
|
||||
<select id="add-window-profile"></select>
|
||||
</label>
|
||||
<p class="chat-dialog-hint">勾选要加入的模型,可以多选。已经在会话里的不能再选。</p>
|
||||
<fieldset class="chat-model-pick">
|
||||
<legend>模型</legend>
|
||||
<div class="chat-compare-list" id="add-window-models"></div>
|
||||
<p class="chat-dialog-hint" id="add-window-models-empty" hidden>
|
||||
请至少再勾选一个模型。
|
||||
</p>
|
||||
</fieldset>
|
||||
<div class="chat-dialog-actions">
|
||||
<button type="submit" class="st-btn st-btn-primary" value="ok">添加</button>
|
||||
<button type="submit" class="st-btn" value="cancel">取消</button>
|
||||
<button type="submit" class="st-btn" value="cancel" formnovalidate>取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
Reference in New Issue
Block a user