import { readFileSync } from "node:fs"; const body = JSON.parse(JSON.parse(readFileSync(process.argv[2], "utf8")).body); const from = Number(process.argv[3] ?? 0); const to = Number(process.argv[4] ?? body.messages.length); body.messages.slice(from, to).forEach((m, i) => { const text = String(m.content ?? ""); console.log("#" + (from + i) + " [" + m.role + "] " + text.length + " 字: " + JSON.stringify(text.slice(0, 90))); });