抓包对比工具补一批一次性脚本:拆预设、对请求、跑 A/B 与拒答抽样。
这些脚本都是我对着酒馆真实请求手工核对用的,留在仓库里方便下次重跑;跑出来的本地数据目录含接口 key,已经写进忽略规则。
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// 按名字挑出预设里的 block,打印正文(用于提炼自研预设)
|
||||
// 用法: node pick-blocks.mjs <preset.json> <每个最多打印字数> <名字片段1> [片段2...]
|
||||
import { readFileSync } from "node:fs";
|
||||
const preset = JSON.parse(readFileSync(process.argv[2], "utf8"));
|
||||
const limit = Number(process.argv[3]);
|
||||
const keys = process.argv.slice(4);
|
||||
for (const p of preset.prompts || []) {
|
||||
const name = String(p.name || p.identifier || "");
|
||||
if (!keys.some((k) => name.includes(k))) continue;
|
||||
const body = String(p.content || "");
|
||||
console.log("\n===== " + name + " (" + body.length + " 字, role=" + (p.role || "system") + ") =====");
|
||||
console.log(body.slice(0, limit));
|
||||
if (body.length > limit) console.log("…(截断,余 " + (body.length - limit) + " 字)");
|
||||
}
|
||||
Reference in New Issue
Block a user