wangdl
|
fe44dec567
|
feat: M-CHAT ChatScope 会话系统完整实现
Deploy API Server / build-and-deploy (push) Successful in 46s
## 数据模型
- ChatSession +13 字段 (scopeType/scopeId/parentKnowledgeBaseId/createdFrom/isPinned/isArchived/isDeleted/modelMode/modelId/lastMessageAt)
- ChatMessage +scopeSnapshot (消息级 scope 快照)
- ChatCitation +lineStart/lineEnd +sourceId 索引
- 5 个新查询索引
## 核心能力
- open-or-create: 同 scope 继续会话 (200) / 新建 (201)
- scope 级检索: global/knowledge_base/material/knowledge_item/folder
- listSessions: scope 过滤 + isDeleted 排除 + isPinned 排序 + 分页元数据
- 自动标题: 首条消息截取 + 词边界处理
- 软删除 + 置顶/归档
- scope 字段创建后不可修改
- 全部端点 userId 鉴权
## 文档
- docs/chat-scope-design.md (设计文档 + 决策表)
- docs/chat-scope-api-contract.md (API 契约)
- docs/chat-scope-test-plan.md (33 条测试用例)
- prisma/migrations/backfill_chat_scope.sql (旧数据回填)
## Bug 修复
- #104: KnowledgeItem.sourceRef 填充 (material scope 检索修复)
- #102: sendMessageStream aiGateway null 保护
- listSessions isDeleted/isArchived 过滤 + 分页
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 17:27:40 +08:00 |
|
wangdl
|
17f16cea67
|
feat: #70 ChatSession 新增 knowledgeItemIds 字段,限定 AI 检索范围
Deploy API Server / build-and-deploy (push) Successful in 46s
- Prisma schema: ChatSession 加 knowledgeItemIds Json? 字段
- createSession: 接受可选 knowledgeItemIds 参数
- loadContext: 支持 itemIds 过滤,传入时只检索指定知识点
- sendMessage/sendMessageStream: 读取 session.knowledgeItemIds 传入 loadContext
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 16:02:38 +08:00 |
|
wangdl
|
6d0cc9b6dc
|
fix: GET /sessions @Body → @Query, 修复对话列表获取失败
Deploy API Server / build-and-deploy (push) Successful in 44s
GET 请求不应使用 @Body 装饰器(NestJS 默认不解析 GET body)。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 15:45:03 +08:00 |
|
wangdl
|
35f2cd6e59
|
fix: SSE charset utf-8 + 服务端 charset header
Deploy API Server / build-and-deploy (push) Successful in 43s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 15:01:16 +08:00 |
|
wangdl
|
aea071e4c9
|
fix: rag-chat controller Response 改为 import type 修复 isolatedModules 编译错误
Deploy API Server / build-and-deploy (push) Successful in 43s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 14:56:13 +08:00 |
|
wangdl
|
6f77162cf8
|
feat: #71 RAG Chat SSE 流式输出 + DeepSeek V4 Pro 思考过程
Deploy API Server / build-and-deploy (push) Failing after 20s
- AiProvider 接口新增 StreamChunk 类型 + generateStream() 方法
- DeepSeekProvider 实现 generateStream():stream=true,读 reader 逐 chunk yield
- AiGatewayService 新增 generateStream():透传 provider stream + 记录用量
- RagChatService 新增 sendMessageStream():流式调用 + 保存最终 AI 回复到 DB
- POST /api/rag-chat/sessions/:id/stream 新 SSE endpoint
- thinking chunk:DeepSeek V4 Pro reasoning_content → type: "thinking"
- 流式模式下禁用 response_format json_object,不阻塞思考过程
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-06 14:49:20 +08:00 |
|
|
|
98bc9961ba
|
feat: M2-07 — RAG Chat module with sessions, messages, citations
Deploy API Server / build-and-deploy (push) Failing after 33s
- ChatSession/ChatMessage/ChatCitation Prisma models
- CAPI: create/list sessions, send message, get history, delete
- Admin AAPI: view user sessions and messages
- Content safety integration on user input
- Placeholder RAG pipeline (real pipeline in M3)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-24 13:39:14 +08:00 |
|