lh 1 ヶ月 前
コミット
75dcc156b3
1 ファイル変更9 行追加5 行削除
  1. 9 5
      app/Services/DeepSeek/DeepSeekService.php

+ 9 - 5
app/Services/DeepSeek/DeepSeekService.php

@@ -8512,6 +8512,9 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
             Utils::throwError('20003:剧集不存在');
         }
         
+        $anime = DB::table('mp_animes')->where('id', $target_anime_id)->first();
+        $anime_script_id = getProp($anime, 'script_id');
+
         $intro = $episode->intro ?? '';
         $art_style = $episode->art_style ?? '';
         $roles = json_decode($episode->roles ?? '[]', true);
@@ -8578,14 +8581,15 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         $user_prompt = "请根据以下要求重新生成分段剧本:\n\n【用户要求】\n{$final_prompt}";
         $user_prompt .= $intro_ref;
         $user_prompt .= $art_style_ref;
-        $user_prompt .= $roles_ref;
-        $user_prompt .= $scenes_ref;
+        $user_prompt .= $reference_content;
+        // $user_prompt .= $roles_ref;
+        // $user_prompt .= $scenes_ref;
         
         $system_prompt = "\n\n【强制要求】\n";
         $system_prompt .= "- 请仅生成<分段剧本>部分,不要生成其他任何内容:";
         $system_prompt .= "- 每个分镜包含:分镜序号、场景、画面、运镜、配音台词、背景音效\n";
-        $system_prompt .= "- 场景必须从【场景列表参考】中选择(如果提供了场景列表)\n";
-        $system_prompt .= "- 出场角色必须从【主体列表参考】中选择(如果提供了主体列表)\n";
+        $system_prompt .= "- 场景必须从【场景列表参考】中选择(如果提供了场景列表),场景名必须精确匹配【场景列表参考】中的名称(如需匹配“酒店会客室-景池筹备会版”,而不是“酒店会客室”,不得缺少“-”后面“:”前面的任何内容,不能自创){$scenes_ref}\n";
+        $system_prompt .= "- 出场角色必须从【主体列表参考】中选择(如果提供了主体列表),角色名必须精准匹配【主体列表参考】中的名称(如需匹配“沈秋岚-程家居家围裙造型”,而不是“沈秋岚”,不得缺少“-”后面“:”前面的任何内容,不能自创){$roles_ref}\n";
         $system_prompt .= "- 保持美术风格的一致性(如果提供了美术风格参考)\n";
         $system_prompt .= "- 参考示例格式如下,此为第一优先规则,必须按以下格式生成内容,请忽略其他任何提示词部分关于规则的描述:
         ###分段剧本
@@ -8633,7 +8637,6 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
         // 获取模型配置
         $model = getProp($data, 'model');
         if (!$model) {
-            $anime = DB::table('mp_animes')->where('id', $target_anime_id)->first();
             $model = $anime ? ($anime->model ?? 'deepseek-v4-pro') : 'deepseek-v4-pro';
         }
         
@@ -8665,6 +8668,7 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
                 'content' => $user_prompt
             ]
         ];
+        // dd($messages);
         
         // 构建请求参数
         $post_data = [