更新skill

This commit is contained in:
ACT丶流星雨 2026-04-06 01:16:27 +08:00
parent 6a5c062a16
commit 1863b743d4
9 changed files with 17 additions and 84259 deletions

View File

@ -39,7 +39,7 @@
1. 用户发起改编请求时,**必须主动询问用户**项目参数(不主动调用 `deepRetrieve`,除非用户要求回想之前的配置)
2. 如果没有已确认的参数,**必须主动询问用户**
- "请确认以下信息:计划拆分为几集?每集大约几分钟?覆盖原著哪些章节?"
3. 用户确认后,**必须校验章节范围**:调用 `get_novel_events` 获取实际可用的章节列表,若用户输入的章节ID中包含不存在的章节,**立即提醒用户**"您输入的章节范围中包含不存在的章节({不存在的章节ID列表}请重新确认原著范围和章节ID列表。",并等待用户修正后再继续
3. 用户确认后,**必须校验章节范围**:调用 `get_novel_events` 获取实际可用的章节列表,若用户输入的章节范围中包含不存在的章节,**立即提醒用户**"您输入的章节范围中包含不存在的章节({不存在的章节范围}),请重新确认原著范围和章节范围。",并等待用户修正后再继续
4. 校验通过后,将参数作为**项目配置**保存,并在所有后续派发指令头部附带
5. 如果用户只给出部分参数,对未给出的参数**逐一追问**,不可使用默认值跳过
@ -51,7 +51,7 @@
- 集数:{totalEpisodes}集
- 单集时长:{episodeDuration}分钟(约{wordsPerEpisode}字台词)
- 原著范围:第{startChapter}-{endChapter}章
- 章节ID列表{chapterIds}
- 章节范围:{chapterIndexs}
- 平台规格:{platform}
- 风格定位:{style}
- 付费策略:{paywall}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -47,6 +47,8 @@ export async function decisionAI(ctx: AgentContext) {
const projectData = await u.db("o_project").where("id", resTool.data.projectId).first();
const novelData = await u.db("o_novel").where("projectId", resTool.data.projectId).select("chapterIndex");
const projectInfo = [
"## 项目信息",
`小说名称:${projectData?.name ?? "未知"}`,
@ -54,12 +56,13 @@ export async function decisionAI(ctx: AgentContext) {
`小说简介:${projectData?.intro ?? "无"}`,
`目标改编影视视觉手册|画风:${projectData?.artStyle ?? "无"}`,
`目标改编视频画幅:${projectData?.videoRatio ?? "16:9"}`,
`章节数量:${novelData.length}`,
].join("\n");
const { textStream } = await u.Ai.Text("scriptAgent").stream({
messages: [
{ role: "system", content: prompt },
{ role: "assistant", content: projectInfo + mem },
{ role: "assistant", content: projectInfo + "\n" + mem },
{ role: "user", content: text },
],
abortSignal,
@ -186,9 +189,7 @@ function createSubAgent(parentCtx: AgentContext) {
"\n",
);
const novelData = await u.db("o_novel").where("projectId", resTool.data.projectId).select("id", "chapterIndex as index");
const projectPrompt = ["## 章节ID映射(ID:章序)", novelData.map((i: any) => `${i.id}:${i.index}`).join(","), ""].join("\n");
const novelData = await u.db("o_novel").where("projectId", resTool.data.projectId).select("chapterIndex");
const formatPrompt = `\n你必须使用如下XML格式写入工作区\nXML不得添加任何额外标签<scriptItem name="剧本名称">剧本内容</scriptItem><scriptItem name="剧本名称">剧本内容</scriptItem><scriptItem name="剧本名称">剧本内容</scriptItem>`;
@ -196,7 +197,7 @@ function createSubAgent(parentCtx: AgentContext) {
prompt,
system: systemPrompt + formatPrompt,
messages: [
{ role: "assistant", content: projectPrompt + "\n" + scriptPrompt },
{ role: "assistant", content: scriptPrompt + `章节数量:${novelData.length}` },
{ role: "user", content: prompt + formatPrompt },
],
name: "编剧",

View File

@ -34,17 +34,17 @@ export default (toolCpnfig: ToolConfig) => {
get_novel_events: tool({
description: "获取章节事件",
inputSchema: z.object({
ids: z.array(z.number()).describe("章节id注意区分"),
chapterIndexs: z.array(z.number()).describe("章节的编号"),
}),
execute: async ({ ids }) => {
console.log("[tools] get_novel_events", ids);
execute: async ({ chapterIndexs }) => {
console.log("[tools] get_novel_events", chapterIndexs);
const thinking = msg.thinking("正在查询章节事件...");
const data = await u
.db("o_novel")
.where("projectId", resTool.data.projectId)
.select("id", "chapterIndex as index", "reel", "chapter", "chapterData", "event", "eventState")
.whereIn("id", ids);
thinking.appendText("正在查询章节ID: " + ids.join(","));
.whereIn("chapterIndex", chapterIndexs);
thinking.appendText("正在查询章节编号: " + chapterIndexs.join(","));
const eventString = data.map((i: any) => [`${i.index}章,标题:${i.chapter},事件:${i.event}`].join("\n")).join("\n");
thinking.appendText("查询结果:\n" + eventString);
thinking.updateTitle("查询章节事件完成");
@ -70,12 +70,12 @@ export default (toolCpnfig: ToolConfig) => {
get_novel_text: tool({
description: "获取小说章节原始文本内容",
inputSchema: z.object({
id: z.string().describe("章节id"),
chapterIndex: z.string().describe("章节编号"),
}),
execute: async ({ id }) => {
console.log("[tools] get_novel_text", "[tools] get_novel_text", id);
execute: async ({ chapterIndex }) => {
console.log("[tools] get_novel_text", "[tools] get_novel_text", chapterIndex);
const thinking = msg.thinking(`正在获取小说章节原文...`);
const data = await u.db("o_novel").where({ id }).select("chapterData").first();
const data = await u.db("o_novel").where("projectId", resTool.data.projectId).where({ chapterIndex }).select("chapterData").first();
const text = data && data?.chapterData ? data.chapterData : "";
thinking.appendText(`获取到原文:\n` + text);
thinking.updateTitle(`获取小说章节原文完成`);