Files
msh-system/scripts/logs/agent-BUG-005-103833.log
scottpan 4be53dcd1b feat: 集成 KieAI 服务,移除 models-integration 子项目
- 添加 Gemini 2.5 Flash 对话接口(流式+非流式)
- 添加 NanoBanana 图像生成/编辑接口
- 添加 Sora2 视频生成接口(文生视频、图生视频、去水印)
- 移除 models-integration 子项目(功能已迁移至主后端)
- 新增测试文档和 Playwright E2E 配置
- 更新前端页面和 API 接口
- 更新后端配置和日志处理
2026-03-03 15:33:50 +08:00

47 lines
1.8 KiB
Plaintext
Raw 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.
BUG-005 已按你的要求修好,修改总结如下。
---
## 1. 前端 `msh_single_uniapp/pages/tool/ai-nutritionist.vue`
**已做修改:**
- **文本/多模态统一走 KieAI Gemini**
逻辑本来就是:`sendToAI` 里对 `text` 和 `multimodal` 都调用 `api.kieaiGeminiChat({ messages, stream: false })`,请求体为 `{ messages: [{ role: 'user', content: 用户输入或图+文 }], stream: false }`,未改。
- **成功时只展示接口返回内容**
- 回复**仅**从 `response.data.choices[0].message.content` 取值并展示。
- 已改为显式使用 `msgObj.content`(不再用 `choice.message.text` 等),并在注释中写明“仅使用接口返回的 content禁止固定话术”。
- **删除固定话术 `getAIResponse`**
- 已移除整个 `getAIResponse(question)` 方法(原关键词匹配的固定回复)。
- 成功时不再使用任何固定话术,只展示接口返回内容。
- **未动 UI**
仅改数据流与回复来源,布局和样式未改。
---
## 2. 前端 `msh_single_uniapp/api/models-api.js`
- **未改**
`kieaiGeminiChat` 已正确:
- POST `/api/front/kieai/gemini/chat`
- 请求体为 `{ messages, stream }`(你要求的 `{ messages: [{ role: 'user', content: 用户输入 }], stream: false }` 已满足)。
---
## 3. 后端 `msh_crmeb_22`ToolKieAIServiceImpl / buildGeminiRequestBody
- **未改**
已确认:
- `buildGeminiRequestBody` 完全用 `request.getMessages()` 透传,没有硬编码 prompt。
- `geminiChat` 只是用该 body 调 KieAI无额外固定内容。
因此后端无需修改。
---
当前数据流为:**用户输入 → POST /api/front/kieai/gemini/chatbody: messages + stream: false→ 前端从 `data.choices[0].message.content` 取回复并展示**,且成功时不再使用任何固定话术。