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