|
|
032de796c8
|
docs: 重构文档结构,规范编号并整合冗余内容
## 主要变更
### 文档重构(减少 1199 行,-23%)
- 01-架构设计.md: 503→369 行 (-27%),删除 DDL/配置示例,精简鉴权/存储描述
- 02-接口文档.md: 1313→570 行 (-57%),删除 Go 接口/Orchestrator 实现/配置管理
- 07-成本控制.md: 65→59 行 (-9%),代码块替换为文件引用
### 文档编号规范化
- 08-功能创意.md → 删除(内容整合到 README.md "功能扩展方向")
- 10-Eino框架与编排设计.md → 08-Eino框架与编排设计.md
- 情景切换.md → 09-情景切换.md
- 12-鉴权体系.md → 10-鉴权体系.md
- 13-令牌桶限流.md → 11-令牌桶限流.md
### 交叉引用更新
- 01-架构设计.md: 更新对鉴权体系/令牌桶限流的引用为新编号
- README.md: 更新文档索引表、推荐阅读顺序、新增功能扩展方向
### 删除过时文档
- 09-技术名词解释.md(内容已整合到 03-技术选型.md)
- 10-Eino重构方案.md(历史记录,已完成)
- 11-Eino框架技术文档.md(已合并到 08)
- 情景切换功能完整文档.md(已规范化为 09)
## 重构原则
- 架构文档聚焦系统结构,移除实现细节
- 接口文档保留纯契约,删除内部实现
- 编号连续(01-11),语义清晰
- 通过交叉引用连接相关文档,避免重复
|
2026-06-21 14:48:03 +08:00 |
|
|
|
2fb23852ef
|
feat: 优化情景切换功能
|
2026-06-20 23:24:32 +08:00 |
|
|
|
ab07e01adf
|
feat: 优化对话历史功能
|
2026-06-20 19:57:36 +08:00 |
|
|
|
eb1b90445f
|
fix: 修复 Eino Graph 类型不匹配和多模态消息问题
- 添加 msg2str 转换节点解决 ChatModel 输出 *schema.Message 与 Splitter 期望 string 的类型不匹配
- 将多模态图片内容从 system 消息移到 user 消息(DashScope API 仅支持 user/tool 角色的多模态内容)
- 修复 Content 和 UserInputMultiContent 不能同时设置的问题
- Splitter 输出改为 StreamReader[string](单句),TTS 改为 TransformableLambda 流式消费
- 修复 .env 中 PostgreSQL DSN 和 Redis ADDR 的 http:// 前缀问题
|
2026-06-19 23:24:01 +08:00 |
|
|
|
4ffd84510e
|
refactor: 清理旧编排代码,新增 eino 包单元测试
删除旧代码:
- orchestrator/pipeline.go: 旧 STT→LLM→TTS 手写 goroutine 管道
- orchestrator/splitter.go: 旧句子切分器
- orchestrator/pipeline_test.go: 旧 Pipeline 测试
- ai/llm/openai.go: 旧 LLM OpenAI 实现(被 eino-ext ChatModel 替代)
- ai/llm/openai_test.go: 旧 LLM 测试
保留的接口和工具:
- orchestrator/orchestrator.go: Orchestrator 接口(ws/handler 依赖)
- orchestrator/sender.go: Sender 接口(eino/callback 依赖)
- ai/llm/llm.go: Request/Chunk/TokenUsage 类型定义
- ai/llm/prompt.go: BuildSystemPrompt(eino/nodes_history 依赖)
- ai/llm/scenarios.go: GetScenarioPrompt(eino/nodes_history 依赖)
新增测试:
- eino/graph_test.go: 13 个测试覆盖类型构建、State 并发安全、
Context 注入、延迟计算、接口实现检查等
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-19 22:04:39 +08:00 |
|
|
|
4b731b5ac0
|
feat: 实现 Eino Graph 构建与 Orchestrator 适配器,切换 main.go
- graph.go: 构建 Graph 拓扑 START→STT→History→ChatModel→Splitter→TTS→Done→END
- 创建 eino-ext ChatModel 对接 DashScope OpenAI 兼容接口
- 统一使用值类型(PipelineInput/PipelineOutput)
- Callback 在运行时通过 Stream option 传入
- adapter.go: EinoOrchestrator 实现 orchestrator.Orchestrator 接口
- 解码 base64 音频/图片,注入 context 值
- 调用 Graph.Stream() 触发惰性执行并消费输出
- 追加用户/助手消息到历史
- main.go: 移除旧 llmService + orchestrator.New()
替换为 eino.NewPipelineGraph() + eino.NewEinoOrchestrator()
- 各节点统一使用值类型,State 传递请求元数据
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-19 21:58:17 +08:00 |
|
|
|
fd5c7712f8
|
feat: 引入 Eino 框架并实现 AI 编排层基础设施与节点
- 引入 cloudwego/eino v0.9.9 和 eino-ext/components/model/openai v0.1.13
- 新增 internal/eino/ 包:
- types.go: PipelineInput/Output、STTOutput、TokenUsage 类型定义
- state.go: PipelineState 跨节点状态收集(线程安全)
- callback.go: ChatModel OnEndWithStreamOutput 回调,逐 token 推送 llm_chunk
- nodes_stt.go: STT Lambda,支持文本/语音输入模式
- nodes_history.go: 历史组装 Lambda,含多模态图片支持
- nodes_splitter.go: 句子分割 Transform Lambda
- nodes_tts.go: TTS Lambda,逐句合成推送音频
- nodes_done.go: Done Lambda,发送 llm_done 并追加历史
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-19 21:49:28 +08:00 |
|