From 134faffbe85d730fa5aff387a73eed59ab1c6dbe Mon Sep 17 00:00:00 2001 From: hub-gif <2487812171@qq.com> Date: Tue, 14 Apr 2026 13:28:18 +0800 Subject: [PATCH] feat: default LLM for report regen, job report_config, and API defaults Made-with: Cursor --- backend/pipeline/jd_runner.py | 10 ++++---- backend/pipeline/views.py | 7 +++++- frontend/src/views/jd/JdAnalysisBuildView.vue | 24 +++++++++++++++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/backend/pipeline/jd_runner.py b/backend/pipeline/jd_runner.py index e6b264d..3e45089 100644 --- a/backend/pipeline/jd_runner.py +++ b/backend/pipeline/jd_runner.py @@ -168,11 +168,11 @@ def get_default_report_config() -> dict[str, Any]: """与 ``jd_competitor_report`` 模块常量一致的默认报告调参(供前端回填)。""" jcr, _ = _jd_crawler_modules() return { - "llm_comment_sentiment": False, - "llm_section_bridges": False, - "llm_matrix_group_summaries": False, - "llm_comment_group_summaries": False, - "llm_price_group_summaries": False, + "llm_comment_sentiment": True, + "llm_section_bridges": True, + "llm_matrix_group_summaries": True, + "llm_comment_group_summaries": True, + "llm_price_group_summaries": True, "comment_focus_words": list(jcr.COMMENT_FOCUS_WORDS), "comment_scenario_groups": [ {"label": lbl, "triggers": list(trs)} diff --git a/backend/pipeline/views.py b/backend/pipeline/views.py index 06b2154..e8373a8 100644 --- a/backend/pipeline/views.py +++ b/backend/pipeline/views.py @@ -144,6 +144,11 @@ class JobListCreateView(APIView): ser = CreatePipelineJobSerializer(data=request.data) ser.is_valid(raise_exception=True) data = ser.validated_data + raw_rc = data.get("report_config") + if not isinstance(raw_rc, dict) or raw_rc == {}: + report_config_initial = get_default_report_config() + else: + report_config_initial = raw_rc job = PipelineJob.objects.create( platform=data["platform"], keyword=data["keyword"], @@ -157,7 +162,7 @@ class JobListCreateView(APIView): request_delay=data.get("request_delay") or "", list_pages=data.get("list_pages") or "", scenario_filter_enabled=data.get("scenario_filter_enabled"), - report_config=data.get("report_config") or {}, + report_config=report_config_initial, status=JobStatus.PENDING, ) t = threading.Thread(target=execute_job, args=(job.id,), daemon=True) diff --git a/frontend/src/views/jd/JdAnalysisBuildView.vue b/frontend/src/views/jd/JdAnalysisBuildView.vue index 76fc3f6..8deb1ca 100644 --- a/frontend/src/views/jd/JdAnalysisBuildView.vue +++ b/frontend/src/views/jd/JdAnalysisBuildView.vue @@ -11,6 +11,8 @@ import { useReportConfigForm } from '../../composables/useReportConfigForm' const { jobs } = useJobs() const selectedId = ref('') +/** 勾选则本次重新生成不走整篇大模型合并(仍先跑规则引擎落盘) */ +const useRulesOnly = ref(false) const regenErr = ref('') const genInFlight = generationInFlightKey() const REGEN_PREFIX = 'regenerate-report:' @@ -156,7 +158,9 @@ async function regenerateReport() { try { const r = await api(`/api/jobs/${id}/regenerate-report/`, { method: 'POST', - body: JSON.stringify({ generator: 'rules' }), + body: JSON.stringify({ + generator: useRulesOnly.value ? 'rules' : 'llm', + }), }) const text = await r.text() if (!r.ok) { @@ -210,12 +214,18 @@ watch(

分析报告生成

- 选择已成功的任务,调整下方统计规则后点「保存以上设置」,再点「重新生成报告」。本页始终按规则引擎更新 - competitor_analysis.md(统计图与表格),不重新爬取。若需大模型整篇稿或 §8.2 等开关,请用「高级 JSON」写入对应字段后保存,或通过 API 调用。 + 选择已成功的任务,调整下方统计规则后点「保存以上设置」,再点「重新生成报告」。默认先规则引擎写出统计稿,再合并大模型补充(需网关与密钥);不重新爬取。各章评价解读等开关由「填入推荐示例」或「高级 JSON」中的 + llm_* 字段控制。 阅读与下载请至 报告查看

+
+ +