feat(aia): Complete AIA V2.0 with universal streaming capabilities
Major Changes: - Add StreamingService with OpenAI Compatible format - Upgrade Chat component V2 with Ant Design X integration - Implement AIA module with 12 intelligent agents - Update API routes to unified /api/v1 prefix - Update system documentation Backend (~1300 lines): - common/streaming: OpenAI Compatible adapter - modules/aia: 12 agents, conversation service, streaming integration - Update route versions (RVW, PKB to v1) Frontend (~3500 lines): - modules/aia: AgentHub + ChatWorkspace (100% prototype restoration) - shared/Chat: AIStreamChat, ThinkingBlock, useAIStream Hook - Update API endpoints to v1 Documentation: - AIA module status guide - Universal capabilities catalog - System overview updates - All module documentation sync Tested: Stream response verified, authentication working Status: AIA V2.0 core completed (85%)
This commit is contained in:
@@ -1,161 +1,161 @@
|
||||
# AIA 模块 V2.1 开发计划
|
||||
# AIA 妯″潡 V2.1 寮€鍙戣<EFBFBD>鍒?
|
||||
|
||||
> **鐗堟湰**锛歏2.1
|
||||
> **创建日期**:2026-01-11
|
||||
> **计划周期**:约 8-11 天
|
||||
> **策略**:重写后端 + 复用数据库 + 新开发前端
|
||||
> **关联PRD**:`01-需求分析/AIA模块PRD.md`
|
||||
> **关联原型**:`01-需求分析/AI智能问答V2.html`
|
||||
> **鍒涘缓鏃ユ湡**锛?026-01-11
|
||||
> **璁″垝鍛ㄦ湡**锛氱害 8-11 澶?
|
||||
> **绛栫暐**锛氶噸鍐欏悗绔?+ 澶嶇敤鏁版嵁搴?+ 鏂板紑鍙戝墠绔?
|
||||
> **鍏宠仈PRD**锛歚01-闇€姹傚垎鏋?AIA妯″潡PRD.md`
|
||||
> **鍏宠仈鍘熷瀷**锛歚01-闇€姹傚垎鏋?AI鏅鸿兘闂<E58598>瓟V2.html`
|
||||
|
||||
---
|
||||
|
||||
## 📋 开发策略概述
|
||||
## 馃搵 寮€鍙戠瓥鐣ユ<E990A3>杩?
|
||||
|
||||
### 鏍稿績鍐崇瓥
|
||||
|
||||
| 缁勪欢 | 绛栫暐 | 鐞嗙敱 |
|
||||
|------|------|------|
|
||||
| **后端** | 🔴 **重写** | 旧版不符合云原生规范(console.log、未使用平台能力) |
|
||||
| **数据库** | ✅ **复用** | aia_schema 已完善,字段满足需求 |
|
||||
| **前端** | 🔴 **新开发** | 复用 shared/components/Chat 通用组件,全新UI |
|
||||
| **鍚庣<EFBFBD>** | 馃敶 **閲嶅啓** | 鏃х増涓嶇<EFBFBD>鍚堜簯鍘熺敓瑙勮寖锛坈onsole.log銆佹湭浣跨敤骞冲彴鑳藉姏锛?|
|
||||
| **鏁版嵁搴?* | 鉁?**澶嶇敤** | aia_schema 宸插畬鍠勶紝瀛楁<EFBFBD>婊¤冻闇€姹?|
|
||||
| **鍓嶇<EFBFBD>** | 馃敶 **鏂板紑鍙?* | 澶嶇敤 shared/components/Chat 閫氱敤缁勪欢锛屽叏鏂癠I |
|
||||
|
||||
### 技术规范
|
||||
### 鎶€鏈<EFBFBD><EFBFBD>鑼?
|
||||
|
||||
| 瑙勮寖 | 瑕佹眰 |
|
||||
|------|------|
|
||||
| **日志** | 使用 `logger` from `@/common/logging`(禁止 console.log) |
|
||||
| **鏃ュ織** | 浣跨敤 `logger` from `@/common/logging`锛堢<EFBFBD>姝?console.log锛?|
|
||||
| **瀛樺偍** | 浣跨敤 `storage` from `@/common/storage` |
|
||||
| **缂撳瓨** | 浣跨敤 `cache` from `@/common/cache` |
|
||||
| **闃熷垪** | 浣跨敤 `jobQueue` from `@/common/jobs` |
|
||||
| **Prompt** | 浣跨敤 `promptService.get()` from `@/common/prompts` |
|
||||
| **浠g爜浣嶇疆** | `backend/src/modules/aia/` |
|
||||
| **API路由** | `/api/v2/aia/*` |
|
||||
| **API璺<EFBFBD>敱** | `/api/v1/aia/*` |
|
||||
|
||||
---
|
||||
|
||||
## 📊 数据库状态(✅ 已完成)
|
||||
## 馃搳 鏁版嵁搴撶姸鎬侊紙鉁?宸插畬鎴愶級
|
||||
|
||||
### 表结构(3个表)
|
||||
### 琛ㄧ粨鏋勶紙3涓<EFBFBD>〃锛?
|
||||
|
||||
```
|
||||
aia_schema.projects ✅ 保留
|
||||
aia_schema.conversations ✅ 保留
|
||||
aia_schema.messages ✅ 保留 + 新增字段
|
||||
aia_schema.projects 鉁?淇濈暀
|
||||
aia_schema.conversations 鉁?淇濈暀
|
||||
aia_schema.messages 鉁?淇濈暀 + 鏂板<E98F82>瀛楁<E7809B>
|
||||
```
|
||||
|
||||
### 新增字段(2026-01-11 已迁移)
|
||||
### 鏂板<EFBFBD>瀛楁<EFBFBD>锛?026-01-11 宸茶縼绉伙級
|
||||
|
||||
| 表 | 字段 | 类型 | 说明 |
|
||||
| 琛?| 瀛楁<E7809B> | 绫诲瀷 | 璇存槑 |
|
||||
|----|------|------|------|
|
||||
| messages | `thinking_content` | TEXT | 深度思考内容 `<think>...</think>` |
|
||||
| messages | `attachments` | JSONB | 附件数组(上限5个,单个≤20MB,文本≤30K tokens) |
|
||||
| messages | `thinking_content` | TEXT | 娣卞害鎬濊€冨唴瀹?`<think>...</think>` |
|
||||
| messages | `attachments` | JSONB | 闄勪欢鏁扮粍锛堜笂闄?涓<>紝鍗曚釜鈮?0MB锛屾枃鏈<E69E83>墹30K tokens锛?|
|
||||
|
||||
### 宸插垹闄よ〃
|
||||
|
||||
| 表 | 原因 |
|
||||
| 琛?| 鍘熷洜 |
|
||||
|----|------|
|
||||
| `general_conversations` | 功能重叠,使用 conversations.project_id = NULL |
|
||||
| `general_conversations` | 鍔熻兘閲嶅彔锛屼娇鐢?conversations.project_id = NULL |
|
||||
| `general_messages` | 鍔熻兘閲嶅彔 |
|
||||
|
||||
---
|
||||
|
||||
## 🗓️ 开发阶段
|
||||
## 馃棑锔?寮€鍙戦樁娈?
|
||||
|
||||
### Phase 1: 后端重写(3-4天)
|
||||
### Phase 1: 鍚庣<EFBFBD>閲嶅啓锛?-4澶╋級
|
||||
|
||||
#### Day 1: 妯″潡楠ㄦ灦 + 鏍稿績鏈嶅姟
|
||||
|
||||
**鐩<>爣**锛氭惌寤烘ā鍧楃粨鏋勶紝杩佺Щ鏍稿績瀵硅瘽鏈嶅姟
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **1.1 鍒涘缓妯″潡鐩<E6BDA1>綍缁撴瀯**
|
||||
```
|
||||
backend/src/modules/aia/
|
||||
鈹溾攢鈹€ controllers/
|
||||
│ ├── conversationController.ts
|
||||
│ ├── agentController.ts
|
||||
│ └── projectController.ts
|
||||
鈹? 鈹溾攢鈹€ conversationController.ts
|
||||
鈹? 鈹溾攢鈹€ agentController.ts
|
||||
鈹? 鈹斺攢鈹€ projectController.ts
|
||||
鈹溾攢鈹€ services/
|
||||
│ ├── conversationService.ts
|
||||
│ ├── agentService.ts
|
||||
│ └── projectService.ts
|
||||
鈹? 鈹溾攢鈹€ conversationService.ts
|
||||
鈹? 鈹溾攢鈹€ agentService.ts
|
||||
鈹? 鈹斺攢鈹€ projectService.ts
|
||||
鈹溾攢鈹€ routes/
|
||||
│ └── index.ts
|
||||
鈹? 鈹斺攢鈹€ index.ts
|
||||
鈹溾攢鈹€ types/
|
||||
│ └── index.ts
|
||||
鈹? 鈹斺攢鈹€ index.ts
|
||||
鈹斺攢鈹€ index.ts
|
||||
```
|
||||
|
||||
- [ ] **1.2 閲嶅啓 conversationService**
|
||||
- 从 legacy 复制核心逻辑
|
||||
- 替换 `console.log` → `logger`
|
||||
- 使用 `prisma.message`(已在 aia_schema)
|
||||
- 浠?legacy 澶嶅埗鏍稿績閫昏緫
|
||||
- 鏇挎崲 `console.log` 鈫?`logger`
|
||||
- 浣跨敤 `prisma.message`锛堝凡鍦?aia_schema锛?
|
||||
- 娣诲姞 `thinkingContent` 澶勭悊閫昏緫
|
||||
- 淇濇寔娴佸紡杈撳嚭鑳藉姏
|
||||
|
||||
- [ ] **1.3 閲嶅啓 agentService**
|
||||
- 鏀圭敤 `promptService.get()` 鑾峰彇 Prompt
|
||||
- 缓存智能体配置(使用 `cache`)
|
||||
- 缂撳瓨鏅鸿兘浣撻厤缃<EFBFBD>紙浣跨敤 `cache`锛?
|
||||
|
||||
- [ ] **1.4 娉ㄥ唽 v2 璺<>敱**
|
||||
- 注册到 `/api/v2/aia/*`
|
||||
- 保持 legacy 路由兼容(逐步迁移)
|
||||
- 娉ㄥ唽鍒?`/api/v1/aia/*`
|
||||
- 淇濇寔 legacy 璺<EFBFBD>敱鍏煎<EFBFBD>锛堥€愭<EFBFBD>杩佺Щ锛?
|
||||
|
||||
**验收标准**:
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 鍩虹<E98DA9>瀵硅瘽鍔熻兘鍙<E58598>敤
|
||||
- [ ] 娴佸紡杈撳嚭姝e父
|
||||
- [ ] 日志输出到 logger
|
||||
- [ ] 鏃ュ織杈撳嚭鍒?logger
|
||||
|
||||
---
|
||||
|
||||
#### Day 2: 深度思考 + 附件上传
|
||||
#### Day 2: 娣卞害鎬濊€?+ 闄勪欢涓婁紶
|
||||
|
||||
**目标**:实现 V2.1 新增功能
|
||||
**鐩<EFBFBD>爣**锛氬疄鐜?V2.1 鏂板<E98F82>鍔熻兘
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **2.1 深度思考模式**
|
||||
- 检测 LLM 输出中的 `<think>...</think>` 标签
|
||||
- [ ] **2.1 娣卞害鎬濊€冩ā寮?*
|
||||
- 妫€娴?LLM 杈撳嚭涓<E59AAD>殑 `<think>...</think>` 鏍囩<EFBFBD>
|
||||
- 鎻愬彇骞跺瓨鍌ㄥ埌 `messages.thinking_content`
|
||||
- 从 `content` 中移除 think 标签
|
||||
- 流式输出时分离 thinking 和 content
|
||||
- 浠?`content` 涓<EFBFBD>Щ闄?think 鏍囩<EFBFBD>
|
||||
- 娴佸紡杈撳嚭鏃跺垎绂?thinking 鍜?content
|
||||
|
||||
- [ ] **2.2 闄勪欢涓婁紶鏈嶅姟**
|
||||
- 使用 `storage.upload()` 上传到 OSS
|
||||
- 调用 Python 微服务提取文本
|
||||
- Token 计数(使用 tiktoken)
|
||||
- 截断处理(超过 30K tokens)
|
||||
- 存储附件信息到 `messages.attachments`
|
||||
- 浣跨敤 `storage.upload()` 涓婁紶鍒?OSS
|
||||
- 璋冪敤 Python 寰<EFBFBD>湇鍔℃彁鍙栨枃鏈?
|
||||
- Token 璁℃暟锛堜娇鐢?tiktoken锛?
|
||||
- 鎴<EFBFBD>柇澶勭悊锛堣秴杩?30K tokens锛?
|
||||
- 瀛樺偍闄勪欢淇℃伅鍒?`messages.attachments`
|
||||
|
||||
- [ ] **2.3 附件注入 LLM 上下文**
|
||||
- 组装附件文本到 User Prompt
|
||||
- 控制总 Token 长度
|
||||
- [ ] **2.3 闄勪欢娉ㄥ叆 LLM 涓婁笅鏂?*
|
||||
- 缁勮<EFBFBD>闄勪欢鏂囨湰鍒?User Prompt
|
||||
- 鎺у埗鎬?Token 闀垮害
|
||||
|
||||
**技术规格**:
|
||||
**鎶€鏈<EFBFBD><EFBFBD>鏍?*锛?
|
||||
|
||||
```typescript
|
||||
// 闄勪欢澶勭悊閰嶇疆
|
||||
const ATTACHMENT_CONFIG = {
|
||||
maxCount: 5, // 每条消息最多5个附件
|
||||
maxCount: 5, // 姣忔潯娑堟伅鏈€澶?涓<>檮浠?
|
||||
maxSizePerFile: 20 * 1024 * 1024, // 鍗曚釜鏂囦欢20MB
|
||||
maxTokens: 30000, // 提取文本最多30K tokens
|
||||
maxTokens: 30000, // 鎻愬彇鏂囨湰鏈€澶?0K tokens
|
||||
supportedTypes: ['pdf', 'docx', 'txt', 'xlsx'],
|
||||
};
|
||||
```
|
||||
|
||||
**验收标准**:
|
||||
- [ ] 深度思考内容正确分离存储
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 娣卞害鎬濊€冨唴瀹规<EFBFBD>纭<EFBFBD>垎绂诲瓨鍌?
|
||||
- [ ] 闄勪欢涓婁紶鎴愬姛
|
||||
- [ ] 闄勪欢鏂囨湰姝g‘娉ㄥ叆 LLM
|
||||
|
||||
---
|
||||
|
||||
#### Day 3: 意图路由 + 知识库集成
|
||||
#### Day 3: 鎰忓浘璺<EFBFBD>敱 + 鐭ヨ瘑搴撻泦鎴?
|
||||
|
||||
**鐩<>爣**锛氬疄鐜板叏灞€鎰忓浘璺<E6B598>敱锛屽畬鍠勭煡璇嗗簱寮曠敤
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **3.1 鎰忓浘璺<E6B598>敱鏈嶅姟**
|
||||
- 鏂板缓 `intentRouterService.ts`
|
||||
@@ -163,27 +163,27 @@ const ATTACHMENT_CONFIG = {
|
||||
- 杩斿洖鐩<E6B496>爣 Agent ID + 棰勫~ Prompt
|
||||
- 娣诲姞 500ms 闃叉姈锛堝墠绔<E5A2A0>疄鐜帮級
|
||||
|
||||
- [ ] **3.2 完善知识库集成**
|
||||
- 复用 PKB 模块的 RAG 检索
|
||||
- 智能引用系统([来源N])
|
||||
- 引用清单格式化
|
||||
- [ ] **3.2 瀹屽杽鐭ヨ瘑搴撻泦鎴?*
|
||||
- 澶嶇敤 PKB 妯″潡鐨?RAG 妫€绱?
|
||||
- 鏅鸿兘寮曠敤绯荤粺锛圼鏉ユ簮N]锛?
|
||||
- 寮曠敤娓呭崟鏍煎紡鍖?
|
||||
|
||||
- [ ] **3.3 API 绔<>偣瀹屽杽**
|
||||
```
|
||||
POST /api/v2/aia/intent/route # 意图路由
|
||||
POST /api/v2/aia/conversations # 创建对话
|
||||
GET /api/v2/aia/conversations # 对话列表
|
||||
GET /api/v2/aia/conversations/:id # 对话详情
|
||||
POST /api/v2/aia/conversations/:id/messages/stream # 发送消息(流式)
|
||||
POST /api/v2/aia/conversations/:id/attachments # 上传附件
|
||||
GET /api/v2/aia/agents # 智能体列表
|
||||
GET /api/v2/aia/agents/:id # 智能体详情
|
||||
POST /api/v1/aia/intent/route # 鎰忓浘璺<EFBFBD>敱
|
||||
POST /api/v1/aia/conversations # 鍒涘缓瀵硅瘽
|
||||
GET /api/v1/aia/conversations # 瀵硅瘽鍒楄〃
|
||||
GET /api/v1/aia/conversations/:id # 瀵硅瘽璇︽儏
|
||||
POST /api/v1/aia/conversations/:id/messages/stream # 鍙戦€佹秷鎭<EFBFBD>紙娴佸紡锛?
|
||||
POST /api/v1/aia/conversations/:id/attachments # 涓婁紶闄勪欢
|
||||
GET /api/v1/aia/agents # 鏅鸿兘浣撳垪琛?
|
||||
GET /api/v1/aia/agents/:id # 鏅鸿兘浣撹<EFBFBD>鎯?
|
||||
```
|
||||
|
||||
**验收标准**:
|
||||
- [ ] 意图路由正确识别并跳转
|
||||
- [ ] 知识库引用正确显示
|
||||
- [ ] 所有 API 端点可用
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 鎰忓浘璺<EFBFBD>敱姝g‘璇嗗埆骞惰烦杞?
|
||||
- [ ] 鐭ヨ瘑搴撳紩鐢ㄦ<EFBFBD>纭<EFBFBD>樉绀?
|
||||
- [ ] 鎵€鏈?API 绔<>偣鍙<E581A3>敤
|
||||
|
||||
---
|
||||
|
||||
@@ -191,23 +191,23 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
**鐩<>爣**锛氬畬鎴愬悗绔<E68297>祴璇曞拰鏂囨。
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **4.1 鍗曞厓娴嬭瘯**
|
||||
- conversationService 娴嬭瘯
|
||||
- 深度思考解析测试
|
||||
- 娣卞害鎬濊€冭В鏋愭祴璇?
|
||||
- 闄勪欢澶勭悊娴嬭瘯
|
||||
|
||||
- [ ] **4.2 闆嗘垚娴嬭瘯**
|
||||
- 瀹屾暣瀵硅瘽娴佺▼
|
||||
- 闄勪欢涓婁紶娴佺▼
|
||||
- 知识库检索流程
|
||||
- 鐭ヨ瘑搴撴<EFBFBD>绱㈡祦绋?
|
||||
|
||||
- [ ] **4.3 API 鏂囨。**
|
||||
- 鏇存柊 REST Client 娴嬭瘯鏂囦欢
|
||||
- 缂栧啓 API 浣跨敤绀轰緥
|
||||
|
||||
**验收标准**:
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 娴嬭瘯瑕嗙洊鏍稿績鍔熻兘
|
||||
- [ ] API 鏂囨。瀹屾暣
|
||||
|
||||
@@ -215,66 +215,66 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
### Phase 2: 鍓嶇<E98D93>寮€鍙戯紙5-7澶╋級
|
||||
|
||||
#### Day 5-6: 智能体大厅(Dashboard)
|
||||
#### Day 5-6: 鏅鸿兘浣撳ぇ鍘咃紙Dashboard锛?
|
||||
|
||||
**鐩<>爣**锛氬疄鐜伴<E9909C>椤垫櫤鑳戒綋澶у巺
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **5.1 鍒涘缓妯″潡鐩<E6BDA1>綍缁撴瀯**
|
||||
```
|
||||
frontend-v2/src/modules/aia/
|
||||
鈹溾攢鈹€ pages/
|
||||
│ ├── Dashboard.tsx # 智能体大厅
|
||||
│ └── Workspace.tsx # 对话工作台
|
||||
鈹? 鈹溾攢鈹€ Dashboard.tsx # 鏅鸿兘浣撳ぇ鍘?
|
||||
鈹? 鈹斺攢鈹€ Workspace.tsx # 瀵硅瘽宸ヤ綔鍙?
|
||||
鈹溾攢鈹€ components/
|
||||
│ ├── AgentPipeline.tsx # 5阶段流水线
|
||||
│ ├── AgentCard.tsx # 智能体卡片
|
||||
│ ├── IntentSearch.tsx # 意图搜索框
|
||||
│ ├── ConversationList.tsx # 历史会话列表
|
||||
│ ├── ThinkingBlock.tsx # 深度思考折叠块
|
||||
│ ├── AttachmentUpload.tsx # 附件上传
|
||||
│ ├── AttachmentCard.tsx # 附件卡片
|
||||
│ └── SlashCommands.tsx # 快捷指令
|
||||
鈹? 鈹溾攢鈹€ AgentPipeline.tsx # 5闃舵<EFBFBD>娴佹按绾?
|
||||
鈹? 鈹溾攢鈹€ AgentCard.tsx # 鏅鸿兘浣撳崱鐗?
|
||||
鈹? 鈹溾攢鈹€ IntentSearch.tsx # 鎰忓浘鎼滅储妗?
|
||||
鈹? 鈹溾攢鈹€ ConversationList.tsx # 鍘嗗彶浼氳瘽鍒楄〃
|
||||
鈹? 鈹溾攢鈹€ ThinkingBlock.tsx # 娣卞害鎬濊€冩姌鍙犲潡
|
||||
鈹? 鈹溾攢鈹€ AttachmentUpload.tsx # 闄勪欢涓婁紶
|
||||
鈹? 鈹溾攢鈹€ AttachmentCard.tsx # 闄勪欢鍗$墖
|
||||
鈹? 鈹斺攢鈹€ SlashCommands.tsx # 蹇<EFBFBD>嵎鎸囦护
|
||||
鈹溾攢鈹€ hooks/
|
||||
│ ├── useConversation.ts
|
||||
│ ├── useAgents.ts
|
||||
│ └── useIntentRouter.ts
|
||||
鈹? 鈹溾攢鈹€ useConversation.ts
|
||||
鈹? 鈹溾攢鈹€ useAgents.ts
|
||||
鈹? 鈹斺攢鈹€ useIntentRouter.ts
|
||||
鈹溾攢鈹€ api/
|
||||
│ └── index.ts
|
||||
鈹? 鈹斺攢鈹€ index.ts
|
||||
鈹溾攢鈹€ types/
|
||||
│ └── index.ts
|
||||
鈹? 鈹斺攢鈹€ index.ts
|
||||
鈹斺攢鈹€ index.tsx
|
||||
```
|
||||
|
||||
- [ ] **5.2 智能体流水线(AgentPipeline)**
|
||||
- 5阶段布局(严格还原 V11 原型)
|
||||
- 3色视觉体系
|
||||
- [ ] **5.2 鏅鸿兘浣撴祦姘寸嚎锛圓gentPipeline锛?*
|
||||
- 5闃舵<EFBFBD>甯冨眬锛堜弗鏍艰繕鍘?V11 鍘熷瀷锛?
|
||||
- 3鑹茶<EFBFBD>瑙変綋绯?
|
||||
- 鍗$墖鐐瑰嚮璺宠浆 Workspace
|
||||
- 工具卡片跳转外部模块(DC/ST)
|
||||
- 宸ュ叿鍗$墖璺宠浆澶栭儴妯″潡锛圖C/ST锛?
|
||||
|
||||
- [ ] **5.3 意图搜索框(IntentSearch)**
|
||||
- [ ] **5.3 鎰忓浘鎼滅储妗嗭紙IntentSearch锛?*
|
||||
- 椤堕儴澶ф悳绱㈡<E7BBB1>
|
||||
- 500ms 闃叉姈
|
||||
- 璋冪敤鎰忓浘璺<E6B598>敱 API
|
||||
- 鑷<>姩璺宠浆鐩<E6B586>爣 Agent
|
||||
|
||||
**验收标准**:
|
||||
- [ ] 5阶段流水线正确展示
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 5闃舵<EFBFBD>娴佹按绾挎<EFBFBD>纭<EFBFBD>睍绀?
|
||||
- [ ] 鎰忓浘鎼滅储鍔熻兘鍙<E58598>敤
|
||||
- [ ] 与原型图一致
|
||||
- [ ] 涓庡師鍨嬪浘涓€鑷?
|
||||
|
||||
---
|
||||
|
||||
#### Day 7-8: 对话工作台(Workspace)
|
||||
#### Day 7-8: 瀵硅瘽宸ヤ綔鍙帮紙Workspace锛?
|
||||
|
||||
**鐩<>爣**锛氬疄鐜版矇娴稿紡瀵硅瘽鐣岄潰
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **7.1 宸ヤ綔鍙板竷灞€**
|
||||
- Gemini 椋庢牸锛堝ぇ鐣欑櫧銆佸皯鍒嗗壊绾匡級
|
||||
- 左侧侧边栏(历史会话,可折叠)
|
||||
- 宸︿晶渚ц竟鏍忥紙鍘嗗彶浼氳瘽锛屽彲鎶樺彔锛?
|
||||
- 涓诲<E6B693>璇濆尯锛圚eader + 娑堟伅鍒楄〃 + 杈撳叆妗嗭級
|
||||
|
||||
- [ ] **7.2 澶嶇敤 Chat 閫氱敤缁勪欢**
|
||||
@@ -283,17 +283,17 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
<ChatContainer
|
||||
providerConfig={{
|
||||
apiEndpoint: '/api/v2/aia/conversations/:id/messages/stream',
|
||||
apiEndpoint: '/api/v1/aia/conversations/:id/messages/stream',
|
||||
requestFn: sendMessageWithStream,
|
||||
}}
|
||||
customMessageRenderer={renderAIAMessage}
|
||||
/>
|
||||
```
|
||||
|
||||
- [ ] **7.3 深度思考折叠块(ThinkingBlock)**
|
||||
- [ ] **7.3 娣卞害鎬濊€冩姌鍙犲潡锛圱hinkingBlock锛?*
|
||||
- 鍙<>姌鍙犵伆鑹插紩鐢ㄥ潡
|
||||
- 鐢熸垚涓<E59E9A>睍寮€锛屽畬鎴愬悗鑷<E68297>姩鏀惰捣
|
||||
- 显示"已深度思考 (耗时 Xs)"
|
||||
- 鏄剧ず"宸叉繁搴︽€濊€?(鑰楁椂 Xs)"
|
||||
|
||||
- [ ] **7.4 闄勪欢涓婁紶缁勪欢**
|
||||
- 鏀<>寔鎷栨嫿涓婁紶
|
||||
@@ -302,13 +302,13 @@ const ATTACHMENT_CONFIG = {
|
||||
- 娑堟伅姘旀场涓嬫柟闄勪欢鍗$墖
|
||||
|
||||
- [ ] **7.5 鍘嗗彶浼氳瘽鍒楄〃**
|
||||
- 按时间分组(今天、昨天、7天前)
|
||||
- 桌面端固定显示
|
||||
- 移动端抽屉滑出
|
||||
- 鎸夋椂闂村垎缁勶紙浠婂ぉ銆佹槰澶┿€?澶╁墠锛?
|
||||
- 妗岄潰绔<EFBFBD>浐瀹氭樉绀?
|
||||
- 绉诲姩绔<EFBFBD>娊灞夋粦鍑?
|
||||
|
||||
**验收标准**:
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] Gemini 椋庢牸 UI
|
||||
- [ ] 深度思考正确展示
|
||||
- [ ] 娣卞害鎬濊€冩<EFBFBD>纭<EFBFBD>睍绀?
|
||||
- [ ] 闄勪欢涓婁紶瀹屾暣娴佺▼
|
||||
- [ ] 鍘嗗彶浼氳瘽鍒囨崲
|
||||
|
||||
@@ -316,30 +316,30 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
#### Day 9: Markdown 澧炲己 + 蹇<>嵎鎸囦护
|
||||
|
||||
**目标**:增强对话体验
|
||||
**鐩<EFBFBD>爣**锛氬<E9949B>寮哄<E5AFAE>璇濅綋楠?
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **9.1 Markdown 娓叉煋澧炲己**
|
||||
- KaTeX 鍏<>紡娓叉煋锛堝尰瀛﹀叕寮忥級
|
||||
- 琛ㄦ牸妯<E789B8>悜婊氬姩
|
||||
- 代码块语法高亮 + 一键复制
|
||||
- 浠g爜鍧楄<EFBFBD>娉曢珮浜?+ 涓€閿<E282AC><E996BF>鍒?
|
||||
|
||||
- [ ] **9.2 快捷指令(SlashCommands)**
|
||||
- [ ] **9.2 蹇<EFBFBD>嵎鎸囦护锛圫lashCommands锛?*
|
||||
- 杈撳叆 `/` 寮瑰嚭鑿滃崟
|
||||
- 支持:/润色, /扩写, /翻译, /导出Word
|
||||
- 鏀<EFBFBD>寔锛?娑﹁壊, /鎵╁啓, /缈昏瘧, /瀵煎嚭Word
|
||||
- 閿<>洏瀵艰埅
|
||||
|
||||
- [ ] **9.3 结果操作栏**
|
||||
- Hover 显示工具栏
|
||||
- 复制(Markdown 源码)
|
||||
- [ ] **9.3 缁撴灉鎿嶄綔鏍?*
|
||||
- Hover 鏄剧ず宸ュ叿鏍?
|
||||
- 澶嶅埗锛圡arkdown 婧愮爜锛?
|
||||
- 閲嶆柊鐢熸垚
|
||||
- 导出 Word(调用 RVW 导出服务)
|
||||
- 瀵煎嚭 Word锛堣皟鐢?RVW 瀵煎嚭鏈嶅姟锛?
|
||||
|
||||
**验收标准**:
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 鍏<>紡姝g‘娓叉煋
|
||||
- [ ] 蹇<>嵎鎸囦护鍙<E68AA4>敤
|
||||
- [ ] 操作栏功能完整
|
||||
- [ ] 鎿嶄綔鏍忓姛鑳藉畬鏁?
|
||||
|
||||
---
|
||||
|
||||
@@ -347,25 +347,25 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
**鐩<>爣**锛氬搷搴斿紡甯冨眬閫傞厤
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **10.1 Dashboard 移动端**
|
||||
- [ ] **10.1 Dashboard 绉诲姩绔?*
|
||||
- 闅愯棌澶嶆潅瀵艰埅
|
||||
- 鍗$墖鍗曞垪娴佸紡甯冨眬
|
||||
- 时间轴样式调整
|
||||
- 鏃堕棿杞存牱寮忚皟鏁?
|
||||
|
||||
- [ ] **10.2 Workspace 移动端**
|
||||
- 侧边栏改为抽屉
|
||||
- 输入框键盘适配(scrollIntoView)
|
||||
- 发送按钮始终可见
|
||||
- [ ] **10.2 Workspace 绉诲姩绔?*
|
||||
- 渚ц竟鏍忔敼涓烘娊灞?
|
||||
- 杈撳叆妗嗛敭鐩橀€傞厤锛坰crollIntoView锛?
|
||||
- 鍙戦€佹寜閽<EFBFBD><EFBFBD>缁堝彲瑙?
|
||||
|
||||
- [ ] **10.3 瑙︽帶浼樺寲**
|
||||
- 按钮 active 态
|
||||
- 鎸夐挳 active 鎬?
|
||||
- 瑙︽帶鍖哄煙浼樺寲
|
||||
|
||||
**验收标准**:
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] md (768px) 鏂<>偣鍝嶅簲姝g‘
|
||||
- [ ] 移动端交互流畅
|
||||
- [ ] 绉诲姩绔<EFBFBD>氦浜掓祦鐣?
|
||||
|
||||
---
|
||||
|
||||
@@ -373,27 +373,27 @@ const ATTACHMENT_CONFIG = {
|
||||
|
||||
**鐩<>爣**锛氬畬鎴愭暣浣撴祴璇曞拰浼樺寲
|
||||
|
||||
**任务清单**:
|
||||
**浠诲姟娓呭崟**锛?
|
||||
|
||||
- [ ] **11.1 端到端测试**
|
||||
- [ ] **11.1 绔<EFBFBD>埌绔<EFBFBD>祴璇?*
|
||||
- 瀹屾暣瀵硅瘽娴佺▼
|
||||
- 闄勪欢涓婁紶娴佺▼
|
||||
- 深度思考流程
|
||||
- 知识库引用流程
|
||||
- 娣卞害鎬濊€冩祦绋?
|
||||
- 鐭ヨ瘑搴撳紩鐢ㄦ祦绋?
|
||||
|
||||
- [ ] **11.2 鎬ц兘浼樺寲**
|
||||
- TTFB < 1.5s
|
||||
- 移动端 LCP < 1s
|
||||
- 绉诲姩绔?LCP < 1s
|
||||
- 鎰忓浘鎼滅储闃叉姈
|
||||
|
||||
- [ ] **11.3 Bug 淇<><E6B787>**
|
||||
|
||||
- [ ] **11.4 鏂囨。鏇存柊**
|
||||
- 更新模块状态文档
|
||||
- 更新系统当前状态
|
||||
- 鏇存柊妯″潡鐘舵€佹枃妗?
|
||||
- 鏇存柊绯荤粺褰撳墠鐘舵€?
|
||||
|
||||
**验收标准**:
|
||||
- [ ] 所有功能正常
|
||||
**楠屾敹鏍囧噯**锛?
|
||||
- [ ] 鎵€鏈夊姛鑳芥<EFBFBD>甯?
|
||||
- [ ] 鎬ц兘杈炬爣
|
||||
- [ ] 鏂囨。瀹屾暣
|
||||
|
||||
@@ -406,22 +406,22 @@ const ATTACHMENT_CONFIG = {
|
||||
```
|
||||
backend/src/modules/aia/
|
||||
鈹溾攢鈹€ controllers/
|
||||
│ ├── conversationController.ts # ~300行
|
||||
│ ├── agentController.ts # ~150行
|
||||
│ └── projectController.ts # ~200行
|
||||
鈹? 鈹溾攢鈹€ conversationController.ts # ~300琛?
|
||||
鈹? 鈹溾攢鈹€ agentController.ts # ~150琛?
|
||||
鈹? 鈹斺攢鈹€ projectController.ts # ~200琛?
|
||||
鈹溾攢鈹€ services/
|
||||
│ ├── conversationService.ts # ~500行(核心)
|
||||
│ ├── agentService.ts # ~200行
|
||||
│ ├── projectService.ts # ~150行
|
||||
│ ├── intentRouterService.ts # ~100行(新)
|
||||
│ └── attachmentService.ts # ~200行(新)
|
||||
鈹? 鈹溾攢鈹€ conversationService.ts # ~500琛岋紙鏍稿績锛?
|
||||
鈹? 鈹溾攢鈹€ agentService.ts # ~200琛?
|
||||
鈹? 鈹溾攢鈹€ projectService.ts # ~150琛?
|
||||
鈹? 鈹溾攢鈹€ intentRouterService.ts # ~100琛岋紙鏂帮級
|
||||
鈹? 鈹斺攢鈹€ attachmentService.ts # ~200琛岋紙鏂帮級
|
||||
鈹溾攢鈹€ routes/
|
||||
│ └── index.ts # ~100行
|
||||
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
|
||||
鈹溾攢鈹€ types/
|
||||
│ └── index.ts # ~100行
|
||||
└── index.ts # ~20行
|
||||
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
|
||||
鈹斺攢鈹€ index.ts # ~20琛?
|
||||
|
||||
预计总计:~2000行
|
||||
棰勮<EFBFBD>鎬昏<EFBFBD>锛殈2000琛?
|
||||
```
|
||||
|
||||
### 鍓嶇<E98D93>鏂板<E98F82>鏂囦欢
|
||||
@@ -429,28 +429,28 @@ backend/src/modules/aia/
|
||||
```
|
||||
frontend-v2/src/modules/aia/
|
||||
鈹溾攢鈹€ pages/
|
||||
│ ├── Dashboard.tsx # ~400行
|
||||
│ └── Workspace.tsx # ~500行
|
||||
鈹? 鈹溾攢鈹€ Dashboard.tsx # ~400琛?
|
||||
鈹? 鈹斺攢鈹€ Workspace.tsx # ~500琛?
|
||||
鈹溾攢鈹€ components/
|
||||
│ ├── AgentPipeline.tsx # ~300行
|
||||
│ ├── AgentCard.tsx # ~100行
|
||||
│ ├── IntentSearch.tsx # ~150行
|
||||
│ ├── ConversationList.tsx # ~200行
|
||||
│ ├── ThinkingBlock.tsx # ~100行
|
||||
│ ├── AttachmentUpload.tsx # ~200行
|
||||
│ ├── AttachmentCard.tsx # ~80行
|
||||
│ └── SlashCommands.tsx # ~150行
|
||||
鈹? 鈹溾攢鈹€ AgentPipeline.tsx # ~300琛?
|
||||
鈹? 鈹溾攢鈹€ AgentCard.tsx # ~100琛?
|
||||
鈹? 鈹溾攢鈹€ IntentSearch.tsx # ~150琛?
|
||||
鈹? 鈹溾攢鈹€ ConversationList.tsx # ~200琛?
|
||||
鈹? 鈹溾攢鈹€ ThinkingBlock.tsx # ~100琛?
|
||||
鈹? 鈹溾攢鈹€ AttachmentUpload.tsx # ~200琛?
|
||||
鈹? 鈹溾攢鈹€ AttachmentCard.tsx # ~80琛?
|
||||
鈹? 鈹斺攢鈹€ SlashCommands.tsx # ~150琛?
|
||||
鈹溾攢鈹€ hooks/
|
||||
│ ├── useConversation.ts # ~150行
|
||||
│ ├── useAgents.ts # ~100行
|
||||
│ └── useIntentRouter.ts # ~80行
|
||||
鈹? 鈹溾攢鈹€ useConversation.ts # ~150琛?
|
||||
鈹? 鈹溾攢鈹€ useAgents.ts # ~100琛?
|
||||
鈹? 鈹斺攢鈹€ useIntentRouter.ts # ~80琛?
|
||||
鈹溾攢鈹€ api/
|
||||
│ └── index.ts # ~200行
|
||||
鈹? 鈹斺攢鈹€ index.ts # ~200琛?
|
||||
鈹溾攢鈹€ types/
|
||||
│ └── index.ts # ~100行
|
||||
└── index.tsx # ~50行
|
||||
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
|
||||
鈹斺攢鈹€ index.tsx # ~50琛?
|
||||
|
||||
预计总计:~2900行
|
||||
棰勮<EFBFBD>鎬昏<EFBFBD>锛殈2900琛?
|
||||
```
|
||||
|
||||
---
|
||||
@@ -466,8 +466,8 @@ frontend-v2/src/modules/aia/
|
||||
| `cache` | `@/common/cache` | Redis/PG缂撳瓨 |
|
||||
| `jobQueue` | `@/common/jobs` | 寮傛<E5AFAE>浠诲姟 |
|
||||
| `promptService` | `@/common/prompts` | Prompt绠$悊 |
|
||||
| `LLMFactory` | `@/common/llm` | LLM适配器 |
|
||||
| `prisma` | `@/config/database` | 数据库 |
|
||||
| `LLMFactory` | `@/common/llm` | LLM閫傞厤鍣?|
|
||||
| `prisma` | `@/config/database` | 鏁版嵁搴?|
|
||||
| `ExtractionClient` | `@/clients` | 鏂囨。鎻愬彇 |
|
||||
| `TokenService` | `@/services` | Token璁℃暟 |
|
||||
|
||||
@@ -476,7 +476,7 @@ frontend-v2/src/modules/aia/
|
||||
| 渚濊禆 | 鏉ユ簮 | 璇存槑 |
|
||||
|------|------|------|
|
||||
| `ChatContainer` | `@/shared/components/Chat` | 閫氱敤瀵硅瘽缁勪欢 |
|
||||
| `Ant Design` | `antd` | UI组件库 |
|
||||
| `Ant Design` | `antd` | UI缁勪欢搴?|
|
||||
| `Ant Design X` | `@ant-design/x` | AI瀵硅瘽缁勪欢 |
|
||||
| `KaTeX` | `katex` | 鍏<>紡娓叉煋 |
|
||||
| `react-markdown` | `react-markdown` | Markdown娓叉煋 |
|
||||
@@ -487,37 +487,37 @@ frontend-v2/src/modules/aia/
|
||||
|
||||
| 椋庨櫓 | 姒傜巼 | 褰卞搷 | 缂撹В鎺<D092>柦 |
|
||||
|------|------|------|---------|
|
||||
| 流式输出兼容性 | 中 | 高 | 复用已验证的 SSE 代码 |
|
||||
| 附件提取超时 | 中 | 中 | 使用 jobQueue 异步处理 |
|
||||
| 移动端适配问题 | 低 | 中 | 提前规划断点和布局 |
|
||||
| Prompt管理服务未就绪 | 低 | 中 | 可临时回退到文件读取 |
|
||||
| 娴佸紡杈撳嚭鍏煎<EFBFBD>鎬?| 涓?| 楂?| 澶嶇敤宸查獙璇佺殑 SSE 浠g爜 |
|
||||
| 闄勪欢鎻愬彇瓒呮椂 | 涓?| 涓?| 浣跨敤 jobQueue 寮傛<EFBFBD>澶勭悊 |
|
||||
| 绉诲姩绔<EFBFBD>€傞厤闂<EFBFBD><EFBFBD> | 浣?| 涓?| 鎻愬墠瑙勫垝鏂<E59E9D>偣鍜屽竷灞€ |
|
||||
| Prompt绠$悊鏈嶅姟鏈<EFBFBD>氨缁?| 浣?| 涓?| 鍙<>复鏃跺洖閫€鍒版枃浠惰<E6B5A0>鍙?|
|
||||
|
||||
---
|
||||
|
||||
## ✅ 验收标准
|
||||
## 鉁?楠屾敹鏍囧噯
|
||||
|
||||
### 鍔熻兘楠屾敹
|
||||
|
||||
- [ ] 智能体大厅完整展示
|
||||
- [ ] 鏅鸿兘浣撳ぇ鍘呭畬鏁村睍绀?
|
||||
- [ ] 鎰忓浘鎼滅储姝g‘璺<E28098>敱
|
||||
- [ ] 澶氳疆瀵硅瘽姝e父
|
||||
- [ ] 娴佸紡杈撳嚭娴佺晠
|
||||
- [ ] 深度思考正确折叠
|
||||
- [ ] 娣卞害鎬濊€冩<EFBFBD>纭<EFBFBD>姌鍙?
|
||||
- [ ] 闄勪欢涓婁紶瀹屾暣
|
||||
- [ ] 知识库引用正确
|
||||
- [ ] 鐭ヨ瘑搴撳紩鐢ㄦ<EFBFBD>纭?
|
||||
- [ ] 蹇<>嵎鎸囦护鍙<E68AA4>敤
|
||||
- [ ] 绉诲姩绔<E5A7A9>€傞厤姝e父
|
||||
|
||||
### 鎬ц兘楠屾敹
|
||||
|
||||
- [ ] TTFB < 1.5s
|
||||
- [ ] 移动端 LCP < 1s
|
||||
- [ ] 绉诲姩绔?LCP < 1s
|
||||
- [ ] 鎰忓浘鎼滅储鍝嶅簲 < 500ms
|
||||
|
||||
### 璐ㄩ噺楠屾敹
|
||||
|
||||
- [ ] 无 console.log(使用 logger)
|
||||
- [ ] 代码符合云原生规范
|
||||
- [ ] 鏃?console.log锛堜娇鐢?logger锛?
|
||||
- [ ] 浠g爜绗﹀悎浜戝師鐢熻<EFBFBD>鑼?
|
||||
- [ ] API 鏂囨。瀹屾暣
|
||||
- [ ] 鍗曞厓娴嬭瘯瑕嗙洊鏍稿績鍔熻兘
|
||||
|
||||
@@ -527,13 +527,14 @@ frontend-v2/src/modules/aia/
|
||||
|
||||
| 鏃ユ湡 | 鐗堟湰 | 鍐呭<E98D90> |
|
||||
|------|------|------|
|
||||
| 2026-01-11 | V1.0 | 创建开发计划 |
|
||||
| 2026-01-11 | V1.0 | 鍒涘缓寮€鍙戣<EFBFBD>鍒?|
|
||||
|
||||
---
|
||||
|
||||
**计划制定人**:AI Assistant
|
||||
**审核人**:待定
|
||||
**批准人**:待定
|
||||
**璁″垝鍒跺畾浜?*锛欰I Assistant
|
||||
**瀹℃牳浜?*锛氬緟瀹?
|
||||
**鎵瑰噯浜?*锛氬緟瀹?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user