Files
2026-05-31 21:45:14 +08:00

76 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Acceptance
## 验证分类
### 启动验证
| 检查项 | 结果 |
|---|---|
| `mvn compile` | ✅ 无错误 |
| `mvn spring-boot:run` | ✅ 4.5s 启动,端口 9900 |
| `ChatModel` 路由 | ✅ `keyword=deepseek` → `DeepSeekChatModel` |
| `EmbeddingModel` 路由 | ✅ `keyword=siliconflow` → Bean 名匹配 `siliconFlowEmbeddingModel` |
| Milvus 连接 | ✅ Zilliz Cloud 连接成功, `biz` collection 已 load |
| Mock 模式 | ✅ Prometheus Mock + CLS Mock 均启用 |
**启动命令**:
```bash
mvn spring-boot:run
```
**启动需要**:DeepSeek API Key、SiliconFlow API Key 已在 yml 中配置。无需其他外部服务(Prometheus/CLS 使用 Mock)。
**已知 NPE 修复**:
- `ChatService.getToolCallbacks()` / `logAvailableTools()` — tools 为 null 时兜底
- `ChatController` `/ai_ops` — tools 为 null 时返回空数组
- `ChatService` + `ChatController` 中 `ToolCallbackProvider` 改为 `@Autowired(required = false)`
- 原因:MCP 客户端禁用后框架不提供 `ToolCallbackProvider` Bean
### 脚本验证
| 测试 | 覆盖 | 结果 |
|---|---|---|
| `ChatAndEmbeddingSmokeTest#contextLoads` | Spring 容器启动 + Bean 注入 | ✅ 通过 |
| `ChatAndEmbeddingSmokeTest#chatModelPrimaryBeanWorks` | ModelRoutingConfig ChatModel 路由 | ✅ 通过 |
| `ChatAndEmbeddingSmokeTest#chatServiceAcceptsChatModelInterface` | ReactAgent 接受 ChatModel 接口 | ✅ 通过 |
| `FullPipelineSmokeTest#chatDeepSeekWorks` | DeepSeek V4 Flash 真实 API 调用 | ✅ 通过 |
| `FullPipelineSmokeTest#embeddingBgeM3Works` | BGE-M3 1024 维向量生成 | ✅ 通过 |
| `FullPipelineSmokeTest#embeddingBatchWorks` | 批量向量生成 | ✅ 通过 |
| `FullPipelineSmokeTest#milvusSearchWorks` | Milvus 连接 + 搜索 | ✅ 通过(collection 无数据) |
**运行命令**:
```bash
mvn test -Dtest="ChatAndEmbeddingSmokeTest" -DfailIfNoTests=false
mvn test -Dtest="FullPipelineSmokeTest" -DfailIfNoTests=false
```
### 静态验证
| 检查项 | 方法 | 结果 |
|---|---|---|
| DashScope SDK import 全部清除 | `grep -r "com.alibaba.dashscope" src/` | ✅ 0 匹配 |
| 编译通过 | `mvn compile -q` | ✅ 无错误 |
### 未验证
| 项目 | 原因 | 建议 |
|---|---|---|
| RagService SSE 流式对话 | 需启动应用 + 前端 | 用 `/run` skill 启动后手动验证 |
| AiOpsService 多 Agent 编排 | 需要真实 Prometheus 告警 + CLS 日志 | 配置 MCP 端点和真实环境后验证 |
| MCP 客户端 | 当前禁用(`enabled: false`) | 恢复 MCP 配置后验证 |
| 真实文档向量存入 Milvus | collection 为空 | 上传文件后通过 `/api/upload` 验证 |
## 文件变更统计
```
12 files changed, 140 insertions(+), 312 deletions(-)
+ 2 new files: ModelRoutingConfig.java, SiliconFlowEmbeddingConfig.java
+ 2 test files: ChatAndEmbeddingSmokeTest.java, FullPipelineSmokeTest.java
```
## 已知限制
- OpenAI starter 仍保留(供 SiliconFlow Embedding 复用 `OpenAiApi`),其 `openAiChatModel` Bean 闲置
- `spring.ai.openai.api-key: unused` 是为了满足 auto-config 最低要求
- 如需清理闲置 Bean,可排除 OpenAI auto-config 的 ChatModel 部分