预设兼容:按真实抓包对齐装配与包装层,补上声明式工具与预设正则。

- 装配只认 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:
2026-10-23 00:13:08 +08:00
parent ed09e5c831
commit 9dc927282f
94 changed files with 11558 additions and 413 deletions
+14
View File
@@ -29,6 +29,20 @@ const out = await evaluate(page, `(async () => {
jq("#settings_preset_openai").val(String(names[want])).trigger("change");
await new Promise((r) => setTimeout(r, 900));
}
// 页面重载后可能没选角色:先把探针卡选上
if (window.SillyTavern.getContext().name2 !== "ProbeCard") {
await window.SillyTavern.getContext().getCharacters();
const list = window.SillyTavern.getContext().characters || [];
const idx = list.findIndex((c) => c.name === "ProbeCard");
const other = list.findIndex((c) => c.name !== "ProbeCard");
if (idx >= 0) {
for (let t = 0; t < 40 && window.SillyTavern.getContext().name2 !== "ProbeCard"; t++) {
if (t === 0 && other >= 0) await window.SillyTavern.getContext().selectCharacterById(other);
await window.SillyTavern.getContext().selectCharacterById(idx);
await new Promise((r) => setTimeout(r, 400));
}
}
}
await window.SillyTavern.getContext().clearChat({ clearData: true });
const before = window.SillyTavern.getContext().chatCompletionSettings;
const state = { preset: before.preset_settings_openai, temp: before.temp_openai, maxTokens: before.openai_max_tokens, functionCalling: before.function_calling, squash: before.squash_system_messages };