Feature/model - #40
Merged
Merged
Conversation
- quickRewriteFn 从占位符改为真正调 cm.Generate 做改写 - 新增 5 类意图: greeting/chitchat/question/identity/meta - greeting/chitchat 设置 SkipRetrieve=true 跳过知识库 - BuildMsgs 用 RewrittenQuery 替换用户消息内容 - eino_adapter Retrieve 空 query 快速返回 nil - 全链路降级: ChatModel 缺失/Generate 失败/JSON 解析失败 fallback 原始 query
- chat_prompt_builder UserCtx 从 4 字段扩展到 12 字段 - 新增 toAgentPromptUserContext 辅助函数做字段映射 - 删除 execute.go 中冗余的 buildEnhancedSystemPromptForAgent - PromptBuilder.BuildSystem 统一作为唯一 Prompt 构造入口
- mockChatModel 实现 eino BaseChatModel(Generate + Stream) - 6 组 doRewriteWithLLM 测试覆盖: - greeting 意图识别 + skipRetrieve=true + rewritten fallback 原始 query - question 指代消解(历史上下文拼入 + keywords 提取) - chitchat 意图识别 + skipRetrieve=true - 降级链路:无 ChatModel / Generate 报错 / JSON 解析失败 均 fallback 原始 query - init() 调用 logger.InitDefault() 避免 nil pointer - go build / go vet / go test ./... 全通过
- ChatMessage entity 加 Embedding vector(1024) 字段 - Repository 新增 SearchRecentByVector (pgvector 余弦距离) + UpdateEmbedding - chat_service 写入路径后台异步算 embedding (5s 超时,失败 warn) - context_service 读取路径: 向量语义检索优先, ILIKE 关键词兜底 - DB migration 已执行: pgvector 0.8.2 + HNSW 索引
- 新增 tool_middleware.go: 拦截 delete_document 等危险工具,通过 StatefulInterrupt 中断执行 - 新增 runner_adapter.go: 将 Eino InterruptSignal 转换为 AgentEvent.Interrupt 事件 - 新增 checkpoint_store.go + gob 注册: 持久化 InterruptState,支持恢复执行 - engine/execute/engine_tools 接入中间件,callback 处理中断回调 - prompt 增加危险工具澄清规则: 目标不明确先反问用户,禁止编造参数 - go.mod 更新 eino 版本
…t 字段 - 新增 entity.AgentCheckpoint: 存储 Eino Checkpoint 快照(gob 序列化) - ChatSession 新增 PendingCheckpoint 字段: 记录待审批的 checkpoint 信息 - 新增 AgentCheckpointRepository: checkpoint 的 CRUD - ChatSessionRepository 扩展: SetPendingCheckpoint / ClearPendingCheckpoint / HasPendingCheckpoint - migrate/main.go 补充: AutoMigrate AgentCheckpoint + ChatSession
- chat_service_mode.go: AgentEvent.Interrupt → StreamEvent 转换,持久化 pending_checkpoint - chat_service.go: SendMessage 检测 HasPendingCheckpoint,恢复流程跳过 saveUserMessage - chat_res.go: StreamEvent 新增 checkpoint_id / interrupt_id / interrupt_info 字段 - chat_service_graph_quick.go / mapper.go: 适配新的事件结构
- useChat.ts: 新增 pendingApproval 状态、approvePending / cancelApproval 操作 - interrupt 事件处理: 不 push 多余纯文本气泡,记录 interruptedAssistantId 供恢复复用 - sendMessage 新增 isResume 参数: 恢复流程不 push 用户气泡(避免审批当成新提问) - done 事件: 更新已有 assistant 消息块而非新建,保持审批前后在同一块 - streamTimeline: interrupt 时不清空,恢复执行后继续累加,done 时合并为完整步骤列表 - ChatPage.vue: 新增 amber 色调审批卡 UI(需要人工确认 / 同意执行 / 拒绝 / 暂不处理) - types/chat.ts: StreamEvent 新增 checkpoint_id / interrupt_id / interrupt_info;ChatSession 新增 pending_checkpoint
- 删除 scripts/init_knowledge_schema.sql(用 GORM AutoMigrate 替代) - 删除 internal/service/chat_service_graph_quick_test.go(依赖未完成,暂不维护) - 删除 internal/tool/providers/http_provider_test.go - 删除 internal/integration/dingtalk/client_test.go
- 恢复 internal/integration/dingtalk/client_test.go - 恢复 scripts/init_knowledge_schema.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.