feat: 升级剧本评分系统为 DeepSeek V4 多维评分体系

变更内容:
- scriptEvalClient: 替换系统提示词为 DeepSeek V4 完整版(六维评分细则、
  评分类别、评分铁律、等级标准),维度满分调整为 hook 20/plot 20/
  character 18/dialogue 15/visual 15/content 12,总分算法改为直接累加,
  模型使用 qwen3.7-max,增加请求链路 console 日志
- ScriptTokensPage: 同步维度满分和描述(角色塑造 18、内容深度 12),
  增加页面挂载和评测流程的 console 日志
- vite.config: esbuild.drop 移除 "console",保留 "debugger",
  确保开发环境 console 日志正常输出
This commit is contained in:
2026-06-02 16:04:26 +08:00
parent bedee3ba8d
commit d1b5d64bc8
3 changed files with 68 additions and 31 deletions
@@ -1,5 +1,5 @@
import { CopyOutlined, DownOutlined, DownloadOutlined, FileTextOutlined, ReloadOutlined, TrophyOutlined, UploadOutlined } from "@ant-design/icons";
import { useMemo, useRef, useState, type ChangeEvent, type KeyboardEvent } from "react";
import { useEffect, useMemo, useRef, useState, type ChangeEvent, type KeyboardEvent } from "react";
import { evaluateScript } from "../../api/scriptEvalClient";
interface ScoreDimension {
@@ -35,9 +35,9 @@ const scoreDimensions: ScoreDimension[] = [
{
key: "character",
label: "角色塑造",
maxScore: 15,
weight: 0.15,
description: "人物立体度、动机合理性、弧光设计",
maxScore: 18,
weight: 0.18,
description: "主角弧光、角色辨识度、动机、配角质量",
},
{
key: "plot",
@@ -63,9 +63,9 @@ const scoreDimensions: ScoreDimension[] = [
{
key: "content",
label: "内容深度",
maxScore: 15,
weight: 0.15,
description: "主题表达、情感共鸣、思想内核",
maxScore: 12,
weight: 0.12,
description: "主题表达、情感共鸣、社会/人性洞察",
},
];
@@ -170,6 +170,10 @@ function ScriptTokensPage() {
const [copied, setCopied] = useState(false);
const fileInputRef = useRef<HTMLInputElement>(null);
useEffect(() => {
console.log("[剧本评分] 页面已加载,ScriptTokensPage mounted");
}, []);
const hasContent = Boolean(script.trim());
const lineNumbers = useMemo(() => {
const count = Math.min(160, Math.max(10, script.split(/\r\n|\r|\n/).length));
@@ -202,14 +206,26 @@ function ScriptTokensPage() {
};
const handleEvaluate = async () => {
console.log("[剧本评测] 点击开始评测,hasContent:", hasContent, "script长度:", script.length);
if (!hasContent) return;
setLoading(true);
setResult(null);
setEvalError(null);
try {
console.log("[剧本评测] 开始评测,剧本长度:", script.length, "字符");
const aiResult = await evaluateScript(script);
console.log("[剧本评测] 评测完成,结果:", {
总分: aiResult.totalScore,
等级: aiResult.grade,
维度得分: aiResult.dimensionScores,
摘要: aiResult.summary,
亮点: aiResult.highlights,
问题: aiResult.issues,
建议: aiResult.suggestions,
});
setResult(aiResult);
} catch (err) {
console.error("[剧本评测] 评测失败:", err);
setEvalError(err instanceof Error ? err.message : "评测服务暂时不可用,请稍后重试");
}
setDetailsExpanded(true);