From 3a2d2c6f0c603b4103a001049a3cb336661ed3b0 Mon Sep 17 00:00:00 2001 From: empty Date: Thu, 8 Jan 2026 11:11:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=86=99=E4=BD=9C?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=80=A7=E5=8E=9F=E7=90=86=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 语义锚定:新增大纲模式输入 (WriterPanel.vue, appStore.js) - 风格对齐:实现参考案例风格提取与可视化 (DeepSeekAPI.js, appStore.js, WriterPanel.vue) - 认知模拟:引入深度模式 Agentic Workflow (Draft->Critique->Refine) - 优化 Prompt 构建:支持风格标签注入 (promptBuilder.js) - 更新文档:添加第一性原理功能说明 (README.md) --- README.md | 16 ++++++ src/api/deepseek.js | 13 +++++ src/components/WriterPanel.vue | 100 +++++++++++++++++++++++++++------ src/stores/app.js | 99 +++++++++++++++++++++++++++++--- src/utils/promptBuilder.js | 5 +- 5 files changed, 206 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 6ca2008..ee81936 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,22 @@ src/ ### 3. 深度集成 - **应用到写作**:实现了从"范式分析"到"写作工坊"的深度数据迁移,包括原文引用、风格约束注入和范式模板自动匹配。 +## 核心功能升级:写作第一性原理 + +本项目已基于写作的"第一性原理"进行了深度重构,旨在解决 AI 写作的本质矛盾: + +### 1. 语义锚定 (Semantic Anchoring) - 解决"写什么" +- **大纲模式 (Outline Mode)**:提供结构化输入(核心主题、目标受众、关键观点),强制用户提供逻辑骨架,有效防止 AI 幻觉和跑题。 +- **原理**:通过高确定性的逻辑约束(Logic)来引导 AI 的概率采样,实现熵减。 + +### 2. 风格对齐 (Style Alignment) - 解决"怎么写" +- **风格显性化**:自动分析参考案例,提取关键风格标签(如 #短句为主 #语气犀利),并在 UI 中可视化展示。 +- **向量特征注入**:将提取的风格标签作为显性特征注入 Prompt,强迫 AI 输出向参考案例的向量空间偏移。 + +### 3. 认知模拟 (Cognition Simulation) - 解决"深度" +- **深度模式 (Deep Mode)**:引入 Agentic Workflow(智能体工作流),模拟人类"初稿 -> 批判 -> 润色"的思维链。 +- **过程可视化**:在界面上实时展示 AI 的"反思"(Critique)和"修正"(Refine)过程,用计算换质量。 + ## 功能特性 ### 1. AI 写作工坊 diff --git a/src/api/deepseek.js b/src/api/deepseek.js index 8cec1a0..acd6ff3 100644 --- a/src/api/deepseek.js +++ b/src/api/deepseek.js @@ -111,6 +111,19 @@ class DeepSeekAPI { } ], { temperature: 0.3 }, onContent) } + + async extractStyle(text, onContent) { + return this._streamRequest([ + { + role: 'system', + content: '你是一个专业的语言风格分析师。请分析给定文本的语言风格,并提取3-5个关键风格标签(如:#短句为主 #语气犀利 #大量隐喻 #数据支撑)。请直接输出标签,用空格分隔,不要有其他解释。' + }, + { + role: 'user', + content: `请分析以下文本的风格:\n\n${text.substring(0, 2000)}` // Limit context length + } + ], { temperature: 0.2 }, onContent) + } } export default DeepSeekAPI diff --git a/src/components/WriterPanel.vue b/src/components/WriterPanel.vue index df4274d..19bb76a 100644 --- a/src/components/WriterPanel.vue +++ b/src/components/WriterPanel.vue @@ -20,15 +20,36 @@
- - +
+ +
+ + +
+
+ +
+ +
+ {{ inputTask.length }} 字 +
+
+ +
+ + + +
@@ -47,15 +68,33 @@
-
-
- 📄 -
+
+
+
+ 📄 {{ ref.title }} - {{ ref.content.substring(0, 20) }}... +
+ +
+ +
+

{{ ref.content.substring(0, 30) }}...

+ + +
+ + 正在分析风格特征... +
+
+ + {{ tag }} +
-
@@ -82,6 +121,20 @@ class="w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-xs focus:border-blue-500 outline-none" placeholder="补充其他要求" > + + +
+
+ + 🧠 深度模式 (Deep Mode) + + 模拟人类“初稿-反思-润色”的思维链 +
+ +
@@ -116,7 +169,7 @@