Files
metona-ai-desktop/electron
thzxx bd6856c7e4 refactor: 解耦 Provider Adapter 继承关系
问题:AgnesAdapter extends DeepSeekAdapter 在架构上不合理。
DeepSeek、Agnes AI、Ollama 是三个完全不同的 API,不应有继承关系。

重构:
  BaseAdapter
  ├── DeepSeekAdapter  (独立)
  ├── AgnesAdapter     (独立)
  └── OllamaAdapter    (独立)

变更:
- 新增 shared/openai-format.ts — 提取 OpenAI 兼容消息/工具格式构建
- 新增 shared/sse-stream.ts   — 提取 SSE 流式解析逻辑
- DeepSeekAdapter  重写为独立继承 BaseAdapter,使用共享工具
- AgnesAdapter     重写为独立继承 BaseAdapter,使用共享工具
- OllamaAdapter    无需变更(原本就独立继承)
- adapters/index.ts 清理导出,移除隐式耦合
2026-06-27 21:41:43 +08:00
..
2026-06-27 21:33:27 +08:00
2026-06-27 21:33:27 +08:00
2026-06-27 21:33:27 +08:00
2026-06-27 21:33:27 +08:00