Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
This commit is contained in:
commit
3d42672e1d
@ -494,6 +494,7 @@ description: 专注于从剧本内容中提取所使用的资产(角色、场
|
|||||||
table.text("sound");
|
table.text("sound");
|
||||||
table.text("lines");
|
table.text("lines");
|
||||||
table.text("state");
|
table.text("state");
|
||||||
|
table.text("group");
|
||||||
table.text("reason");
|
table.text("reason");
|
||||||
table.integer("index");
|
table.integer("index");
|
||||||
table.integer("createTime");
|
table.integer("createTime");
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export default router.post(
|
|||||||
"/",
|
"/",
|
||||||
validateFields({
|
validateFields({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
|
title: z.string(),
|
||||||
images: z.array(z.string()),
|
images: z.array(z.string()),
|
||||||
data: z.array(
|
data: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
@ -23,8 +24,9 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { name, images, data } = req.body as {
|
const { name, title, images, data } = req.body as {
|
||||||
name: string;
|
name: string;
|
||||||
|
title: string;
|
||||||
images: string[];
|
images: string[];
|
||||||
data: { label: string; value: string; data: string }[];
|
data: { label: string; value: string; data: string }[];
|
||||||
};
|
};
|
||||||
@ -72,7 +74,8 @@ export default router.post(
|
|||||||
if (!fs.existsSync(fileDir)) {
|
if (!fs.existsSync(fileDir)) {
|
||||||
fs.mkdirSync(fileDir, { recursive: true });
|
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]);
|
const ossImagesDir = u.getPath(["oss", name]);
|
||||||
|
|
||||||
|
|||||||
@ -205,7 +205,7 @@ export default router.post(
|
|||||||
try {
|
try {
|
||||||
const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data");
|
const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data");
|
||||||
const existingHint = existingAssetsList
|
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({
|
const output = await intansce.invoke({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user