diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 5391348..4334863 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -190,7 +190,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id").notNullable(); table.string("name"); - table.text("rompt"); + table.text("prompt"); table.primary(["id"]); table.unique(["id"]); }, diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 1058d67..69a326a 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,20 +1,12 @@ -// @db-hash 662752a8a62a88e2dc636b6d985d3b87 +// @db-hash d07435d983861c95bb42e6e4742ef1c1 //该文件由脚本自动生成,请勿手动修改 -export interface _o_script_old_20260327 { - 'content'?: string | null; - 'createTime'?: number | null; - 'id'?: number; - 'name'?: string | null; - 'projectId'?: number | null; -} export interface memories { 'content': string; 'createTime': number; 'embedding'?: string | null; 'id'?: string; 'isolationKey': string; - 'name'?: string | null; 'relatedMessageIds'?: string | null; 'role'?: string | null; 'summarized'?: number | null; @@ -54,6 +46,7 @@ export interface o_assets { 'name'?: string | null; 'projectId'?: number | null; 'prompt'?: string | null; + 'promptState'?: string | null; 'remark'?: string | null; 'scriptId'?: number | null; 'startTime'?: number | null; @@ -128,13 +121,11 @@ export interface o_project { export interface o_prompt { 'id'?: number; 'name'?: string | null; - 'rompt'?: string | null; + 'prompt'?: string | null; } export interface o_script { 'content'?: string | null; 'createTime'?: number | null; - 'errorReason'?: string | null; - 'extractState'?: number | null; 'id'?: number; 'name'?: string | null; 'projectId'?: number | null; @@ -236,7 +227,6 @@ export interface o_videoConfig { } export interface DB { - "_o_script_old_20260327": _o_script_old_20260327; "memories": memories; "o_agentDeploy": o_agentDeploy; "o_agentWorkData": o_agentWorkData; diff --git a/src/utils/cleanNovel.ts b/src/utils/cleanNovel.ts index 6380f54..da16103 100644 --- a/src/utils/cleanNovel.ts +++ b/src/utils/cleanNovel.ts @@ -27,8 +27,9 @@ class CleanNovel { private async processChapter(novel: o_novel, intansce: ReturnType): Promise { try { const prompt = await u.getPrompts("event"); + const data = await u.db("o_prompt").where("name", "eventExtraction").first("prompt"); const resData = await intansce.invoke({ - system: prompt, + system: data ? JSON.stringify(data.prompt) : (prompt as string), messages: [ { role: "user",