Skip to content

Commit 038f5b7

Browse files
committed
fix: resolve batch extraction failure (use DeepSeek, remove hardcoded legacy providers)
1 parent 09d4907 commit 038f5b7

File tree

4 files changed

+102
-51
lines changed

4 files changed

+102
-51
lines changed

backend/app/routers/fanfiction.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ async def extract_cards(request: ExtractRequest):
113113
try:
114114
agent = ExtractorAgent(
115115
agent_id="wiki_extractor",
116-
config={
117-
"provider": "openai",
118-
"model": "gpt-4-turbo"
119-
}
116+
config={}
120117
)
121118

122119
proposals = await agent.extract_cards(
@@ -148,10 +145,7 @@ async def batch_extract_cards(request: BatchExtractRequest):
148145
# 2. Batch Agent Processing
149146
agent = BatchExtractorAgent(
150147
agent_id="batch_extractor",
151-
config={
152-
"provider": "openai",
153-
"model": "gpt-4-turbo"
154-
}
148+
config={}
155149
)
156150

157151
# Pass structured data to agent

backend/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# LLM Providers / 大模型提供商配置
44
llm:
5-
default_provider: openai
5+
default_provider: deepseek
66
providers:
77
openai:
88
api_key: ${OPENAI_API_KEY}

frontend/src/pages/FanfictionView.jsx

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -123,50 +123,18 @@ export default function FanfictionView() {
123123
setExtracting(true);
124124
setProposals([]); // Clear previous
125125
try {
126-
// Determine mode: Batch (>5) or Single loop
127-
const isBatch = selectedLinks.length > 5;
128-
129-
if (isBatch) {
130-
console.log(`[Fanfiction] Starting batch extraction for ${selectedLinks.length} URLs`);
131-
const response = await axios.post(`${API_BASE}/fanfiction/extract/batch`, {
132-
project_id: projectId,
133-
urls: selectedLinks
134-
});
135-
136-
if (response.data.success) {
137-
setProposals(response.data.proposals);
138-
setStep(3);
139-
} else {
140-
alert(`批量提取失败: ${response.data.error}`);
141-
}
126+
// Always use Batch Mode for better performance and consistency
127+
console.log(`[Fanfiction] Starting batch extraction for ${selectedLinks.length} URLs`);
128+
const response = await axios.post(`${API_BASE}/fanfiction/extract/batch`, {
129+
project_id: projectId,
130+
urls: selectedLinks
131+
});
142132

143-
} else {
144-
// Legacy serial mode for small batches (<5)
145-
// Extract one by one serially to avoid rate limits
146-
const newProposals = [];
147-
for (const url of selectedLinks) {
148-
try {
149-
// 1. Scrape content
150-
const previewResp = await axios.post(`${API_BASE}/fanfiction/preview`, { url });
151-
if (!previewResp.data.success) continue;
152-
153-
// 2. Extract
154-
const extractResp = await axios.post(`${API_BASE}/fanfiction/extract`, {
155-
project_id: projectId,
156-
title: previewResp.data.title || 'Unknown',
157-
content: previewResp.data.content || '',
158-
max_cards: 1
159-
});
160-
161-
if (extractResp.data.success) {
162-
newProposals.push(...extractResp.data.proposals);
163-
}
164-
} catch (e) {
165-
console.error(`Failed to extract ${url}`, e);
166-
}
167-
}
168-
setProposals(newProposals);
133+
if (response.data.success) {
134+
setProposals(response.data.proposals);
169135
setStep(3);
136+
} else {
137+
alert(`提取失败: ${response.data.error}`);
170138
}
171139

172140
} catch (error) {

gamma_script.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# NOVIX Gamma 演示文稿脚本
2+
3+
---
4+
**[Page 1: 封面]**
5+
# NOVIX: 让 AI 真正记住你的世界
6+
## 深度上下文感知的多智能体小说创作系统
7+
### Context-Aware Multi-Agent Novel Writing System
8+
9+
---
10+
**[Page 2: 痛点引入 - 3秒抓住眼球]**
11+
# 写长篇?AI 有个致命伤: "健忘"
12+
13+
- 📉 **逻辑崩坏**:写到第 50 章,主角忘了第 1 章的承诺
14+
- 😵 **设定 OOC**:高冷剑客突然变成了话痨
15+
- 🗑️ **Token 浪费**:为了保持记忆,每次把几十万字塞进上下文?太贵且无效!
16+
17+
> "这不是创作,这是在对抗遗忘。"
18+
19+
---
20+
**[Page 3: 核心架构 - 真正的 4-Agent 工作流]**
21+
# 不止是 Chatbot,而是精密协作的「AI 编辑部」
22+
23+
我们不相信单一模型能写好长篇。NOVIX 设计了严密的 **4 智能体循环 (The Loop)**
24+
25+
1. ✍️ **Writer (撰稿人)**
26+
* 专注单章节创作,负责文笔与叙事节奏
27+
* 基于当前大纲生成初稿
28+
2. 🧐 **Reviewer (审阅员)**
29+
* 拥有 "批判性思维",检查逻辑漏洞与 OOC
30+
* 提出具体的修改建议,绝不姑息烂文
31+
3. 📝 **Editor (编辑)**
32+
* 综合审阅意见,进行润色与修订
33+
* 输出最终定稿
34+
4. 🗃️ **Archivist (档案员)**
35+
* **幕后核心!** 永不休息的记忆守护者
36+
* 不参与写作,只负责从定稿中提取新设定并归档
37+
38+
---
39+
**[Page 4: 独家技术 - 深度设定卡片系统]**
40+
# Character Card System: 定义灵魂
41+
42+
普通 AI 只记名字,NOVIX 记住**灵魂**
43+
我们的设定卡片系统 (Card Schema) 包含极其丰富的维度:
44+
45+
* 🆔 **基本信息**:姓名、阵营、核心身份
46+
* 🎨 **Appearance (外貌)**:发色、瞳色、衣着细节 (支持 Stable Diffusion 提示词转换)
47+
* 🧠 **Personality (性格)**:MBTI、通过 Tag 管理的性格关键词,确保语气一致性
48+
* 🕸️ **Relationship (羁绊)**:动态维护的人际关系网 (如:A 是 B 的救命恩人)
49+
50+
> "所有卡片均支持 YAML 格式导入/导出,方便版本管理。"
51+
52+
---
53+
**[Page 5: 记忆引擎 - Deep Context Engineering]**
54+
# 它是如何"记住"一切的?
55+
56+
拥有了卡片还不够,关键是如何**用好**它。
57+
58+
1. **实时监听 (Live Listening)**
59+
* Archivist 实时扫描正文,自动更新卡片状态 (如:主角受伤 -> 状态更新)
60+
2. **动态事实表 (Dynamic Canon)**
61+
* 一条贯穿全文的时间轴,记录不可逆的关键事件
62+
3. **精准召回 (Context Retrieval)**
63+
* 写到下一章时,系统自动计算相关性,只召回 Top 5% 的卡片与事实
64+
* **结果**:0 幻觉,100% 逻辑闭环,Token 消耗降低 90%
65+
66+
---
67+
**[Page 6: 重磅更新 - 同人创作神器]**
68+
# 新功能:世界观「冷启动」引擎
69+
## Fanfiction Support & Batch Extraction
70+
71+
写同人原本需要手动整理几十页设定?**现在只需 30 秒。**
72+
73+
* 🌐 **Wiki 直连**: 支持萌娘百科 / Fandom / Wikipedia
74+
***极速提取**: 10 线程并发爬虫 + LLM 聚合处理
75+
* 🧬 **自动构建**: 自动将 Wiki 页面转化为上述的**深度设定卡片**
76+
77+
> "输入一个链接,还你一个完整的世界。"
78+
79+
---
80+
**[Page 7: 结尾 - 愿景与开源]**
81+
# Talk is cheap, Show me the code.
82+
83+
NOVIX 现已完全开源。
84+
我们致力于探索 LLM 在长文本逻辑一致性上的边界。
85+
86+
* ⭐️ **GitHub**: unitagain/NOVIX
87+
* 📦 **Tech Stack**: Python (FastAPI) + React + LangChain
88+
89+
**加入我们,一起构建下一代 AI 写作工具。**

0 commit comments

Comments
 (0)