Files
ai-chat-app/memory/2026-04-15.md

39 lines
1.5 KiB
Markdown
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.
# 2026-04-15 记忆
## 开发事务
### 碎片信息记录 v1.1.0
- 功能:并发编辑冲突解决(乐观锁+版本号机制)
- 实现:
- 每条记录增加 version 字段,每次保存版本号递增
- 客户端保存时携带版本号,服务端检查版本一致性
- 版本冲突时返回 HTTP 409前端显示冲突对话框
- 用户可选择"放弃我的修改"或"强制保存我的版本"
- 旧数据自动添加 version=1
- Git仓库: http://192.168.2.8:12007/coder/snippet-notes v1.1.0
### AI对话系统 v3.0.6
- 问题SiliconFlow平台 Function Calling 第二轮调用兼容
- 核心问题SiliconFlow平台不支持标准 `tool` 消息类型
- 第一轮正常返回 `tool_calls`
- 第二轮传入 `tool` 消息类型 → API返回"参数无效"错误
- 解决方案:
-`tool` 消息转换为 `user` 消息格式
- 收集所有 tool 消息的内容
- 合并为一个用户消息:"\n以下是搜索工具返回的结果...\n请根据以上搜索结果回答..."
- Git仓库: http://192.168.2.8:12007/coder/ai-chat-system v3.0.6
### AI对话系统 v3.0.5(已废弃)
- 临时过滤伪工具调用格式
- v3.0.6 才是根本修复
## 技术经验
### SiliconFlow平台兼容性 ⭐
- SiliconFlow API 不支持标准 OpenAI `tool` 消息类型
- workaround将 tool 结果转换为 user 消息格式
- 这是平台特性,不是 bug需要适配处理
## 备注
- v3.0.5 是临时补救方案v3.0.6 才是正确解决方案
- 记录这个经验,遇到类似平台兼容问题时可以参考