工具去除获取剧本,修改剧本xml

This commit is contained in:
zhishi 2026-03-31 18:49:15 +08:00
parent 3b521e684f
commit 436cc359cd
3 changed files with 7 additions and 5 deletions

View File

@ -176,7 +176,7 @@ function createSubAgent(parentCtx: AgentContext) {
prompt,
system:
systemPrompt +
`\n你必须使用如下XML格式写入工作区\nXML不得添加任何额外标签<script><item name="剧本名称">剧本内容</item><item name="剧本名称">剧本内容</item><item name="剧本名称">剧本内容</item></script>`,
`\n你必须使用如下XML格式写入工作区\nXML不得添加任何额外标签<scriptItem name="剧本名称">剧本内容</scriptItem><scriptItem name="剧本名称">剧本内容</scriptItem><scriptItem name="剧本名称">剧本内容</scriptItem>`,
name: "编剧",
memoryKey: "assistant:execution:script",
});

View File

@ -11,7 +11,6 @@ export const ScriptSchema = z.object({
export const planData = z.object({
storySkeleton: z.string().describe("故事骨架"),
adaptationStrategy: z.string().describe("改编策略"),
script: z.string().describe("剧本内容"),
});
export type planData = z.infer<typeof planData>;
@ -61,10 +60,12 @@ export default (toolCpnfig: ToolConfig) => {
console.log("[tools] get_planData", key);
const thinking = msg.thinking(`正在获取${planDataKeyLabels[key]}工作区数据...`);
const planData: planData = await new Promise((resolve) => socket.emit("getPlanData", { key }, (res: any) => resolve(res)));
thinking.appendText(`获取到${planDataKeyLabels[key]}:\n` + planData[key]);
const value = planData[key];
const valueStr = typeof value === "object" ? JSON.stringify(value, null, 2) : String(value ?? "");
thinking.appendText(`获取到${planDataKeyLabels[key]}:\n` + valueStr);
thinking.updateTitle(`获取${planDataKeyLabels[key]}完成`);
thinking.complete();
return planData[key] ?? "无数据";
return valueStr || "无数据";
},
}),
get_novel_text: tool({

View File

@ -1,4 +1,4 @@
// @db-hash 6be0a80e9c8f541987a4c1e907736237
// @db-hash d1fbadf1691063f5a730337685fd85b1
//该文件由脚本自动生成,请勿手动修改
export interface memories {
@ -73,6 +73,7 @@ export interface o_image {
'filePath'?: string | null;
'id'?: number;
'model'?: string | null;
'reason'?: string | null;
'resolution'?: string | null;
'state'?: string | null;
'type'?: string | null;