lh 3 месяцев назад
Родитель
Сommit
339565bfd7
1 измененных файлов с 13 добавлено и 13 удалено
  1. 13 13
      app/Services/DeepSeek/DeepSeekService.php

+ 13 - 13
app/Services/DeepSeek/DeepSeekService.php

@@ -1102,9 +1102,7 @@ class DeepSeekService
         }
 
         // 提取文件内容
-        if ($content) {
-            $content = filterContent($content);
-        } elseif ($file) {
+        if ($file) {
             $content = $this->extractFileContent($file);
             if (!$content) {
                 Utils::throwError('20003:无法提取文件内容,请检查文件格式');
@@ -1114,6 +1112,8 @@ class DeepSeekService
             if (!$content) {
                 Utils::throwError('20003:无法获取书籍内容,请检查书籍');
             }
+        } elseif ($content) {
+            $content = filterContent($content);
         } else {
             Utils::throwError('20003:请上传文件或选择书籍或输入内容');
         }
@@ -1287,9 +1287,7 @@ class DeepSeekService
         }
 
         // 提取文件内容
-        if ($content) {
-            $content = filterContent($content);
-        } elseif ($file) {
+        if ($file) {
             $content = $this->extractFileContent($file);
             if (!$content) {
                 Utils::throwError('20003:无法提取文件内容,请检查文件格式');
@@ -1299,6 +1297,8 @@ class DeepSeekService
             if (!$content) {
                 Utils::throwError('20003:无法获取书籍内容,请检查书籍');
             }
+        } elseif ($content) {
+            $content = filterContent($content);
         } else {
             Utils::throwError('20003:请上传文件或选择书籍或输入内容');
         }
@@ -1822,7 +1822,7 @@ class DeepSeekService
         $content = getProp($data, 'content', '');
         $bid = getProp($data, 'bid', 0);
         $question =getProp($data, 'question', "请根据实例格式完成剧本大纲");
-        $prompt = getProp($data, 'prompt', '帮我根据给出的内容生成短剧大纲');
+        $prompt = getProp($data, 'prompt');
         $model = getProp($data, 'model', 'v3');
         $model = $model == 'r1' ? 'deepseek-reasoner' : 'deepseek-chat';
         $is_multi = getProp($data, 'is_multi', 1);
@@ -2159,9 +2159,7 @@ class DeepSeekService
         $model = $model == 'r1' ? 'deepseek-reasoner' : 'deepseek-chat';
     
         // 提取文件内容
-        if ($content) {
-            $content = filterContent($content);
-        } elseif ($file) {
+        if ($file) {
             $content = $this->extractFileContent($file);
             if (!$content) {
                 Utils::throwError('20003:无法提取文件内容,请检查文件格式');
@@ -2171,6 +2169,8 @@ class DeepSeekService
             if (!$content) {
                 Utils::throwError('20003:无法获取书籍内容,请检查书籍');
             }
+        } elseif ($content) {
+            $content = filterContent($content);
         } else {
             $content = filterContent(getProp($anime, 'content'));
         }
@@ -2594,9 +2594,7 @@ class DeepSeekService
         $existing_scenes = is_array($existing_scenes) ? $existing_scenes : [];
 
         // 提取文件内容
-        if ($content) {
-            $uploaded_content = filterContent((string)getProp($data, 'content', ''));
-        } elseif ($file) {
+        if ($file) {
             $uploaded_content = $this->extractFileContent($file);
             if (!$uploaded_content) {
                 Utils::throwError('20003:无法提取文件内容,请检查文件格式');
@@ -2606,6 +2604,8 @@ class DeepSeekService
             if (!$uploaded_content) {
                 Utils::throwError('20003:无法获取书籍内容,请检查书籍');
             }
+        }elseif ($content) {
+            $uploaded_content = filterContent((string)getProp($data, 'content', ''));
         }else {
             $uploaded_content = '';
         }