chengkai3
|
7ef266e4a0
|
feat:[FL-181][AI问答要支持function call]
实现AI问答的function call功能,支持调用系统接口进行查询。
改动内容:
1. 数据库扩展:
- 在ai_chat_messages表增加tool_calls和tool_call_id字段
- 创建数据库迁移文件
2. 模型和Schema更新:
- AiChatMessage模型增加tool_calls(JSON)和tool_call_id字段
- AiChatMessageSummary schema增加对应字段
3. Function Call实现:
- 定义4个可调用函数:query_tower_models、query_lines、query_users、query_system_params
- 实现_execute_function处理函数调用并返回格式化结果
- 更新_call_openai_api支持tools参数
4. 消息流程更新:
- 重构send_message支持完整的function call流程
- 流程:用户消息 -> AI请求function call -> 执行函数 -> AI基于结果回复
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
|
2026-06-22 23:59:13 +08:00 |
|