This commit is contained in:
小帅 2026-03-31 18:18:11 +08:00
commit 3d42672e1d
3 changed files with 7 additions and 3 deletions

View File

@ -494,6 +494,7 @@ description: 专注于从剧本内容中提取所使用的资产(角色、场
table.text("sound");
table.text("lines");
table.text("state");
table.text("group");
table.text("reason");
table.integer("index");
table.integer("createTime");

View File

@ -12,6 +12,7 @@ export default router.post(
"/",
validateFields({
name: z.string(),
title: z.string(),
images: z.array(z.string()),
data: z.array(
z.object({
@ -23,8 +24,9 @@ export default router.post(
}),
async (req, res) => {
try {
const { name, images, data } = req.body as {
const { name, title, images, data } = req.body as {
name: string;
title: string;
images: string[];
data: { label: string; value: string; data: string }[];
};
@ -72,7 +74,8 @@ export default router.post(
if (!fs.existsSync(fileDir)) {
fs.mkdirSync(fileDir, { recursive: true });
}
fs.writeFileSync(filePath, item.data, "utf-8");
const content = item.value === "README" ? `# ${title}\n${item.data}` : item.data;
fs.writeFileSync(filePath, content, "utf-8");
}
const ossImagesDir = u.getPath(["oss", name]);

View File

@ -205,7 +205,7 @@ export default router.post(
try {
const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data");
const existingHint = existingAssetsList
? `\n\n【已有资产列表】${existingAssetsList}\n对于已有资产如果在剧本中出现只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 prompt/desc/type。对于新发现的资产不在已有列表中请在 newAssets 中给出完整信息。`
? `\n\n【已有资产列表】${existingAssetsList}\n对于已有资产如果在剧本中出现只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 desc/type。对于新发现的资产不在已有列表中请在 newAssets 中给出完整信息。`
: "";
const output = await intansce.invoke({