mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
feat(ai): 重构AI聊天模块,使用agno框架替代langchain
- 移除langchain相关依赖,引入agno作为大模型开发框架 - 重构聊天会话和消息存储,使用agno的TeamSession管理 - 合并chat_message和chat_session模块为统一的chat模块 - 更新前端API和类型定义,适配新的后端接口 - 优化数据库日志字段类型,根据数据库类型自动选择 - 重构AI助手组件,使用新的聊天API - 清理不再使用的模型、控制器和服务代码
This commit is contained in:
@@ -2300,246 +2300,14 @@
|
||||
"redirect": "/ai/chat",
|
||||
"description": "AI管理",
|
||||
"children": [
|
||||
{
|
||||
"name": "会话标题",
|
||||
"type": 2,
|
||||
"icon": "el-icon-ChatLineRound",
|
||||
"order": 1,
|
||||
"permission": "module_ai:chat_session:query",
|
||||
"route_name": "ChatSession",
|
||||
"route_path": "/ai/chat_session",
|
||||
"component_path": "module_ai/chat_session/index",
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话标题",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话标题",
|
||||
"children": [
|
||||
{
|
||||
"name": "会话标题详情",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"permission": "module_ai:chat_session:detail",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话标题详情",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话标题详情"
|
||||
},
|
||||
{
|
||||
"name": "创建会话标题",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 2,
|
||||
"permission": "module_ai:chat_session:create",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "创建会话标题",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "创建会话标题"
|
||||
},
|
||||
{
|
||||
"name": "修改会话标题",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 3,
|
||||
"permission": "module_ai:chat_session:update",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "修改会话标题",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "修改会话标题"
|
||||
},
|
||||
{
|
||||
"name": "删除会话标题",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 4,
|
||||
"permission": "module_ai:chat_session:delete",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "删除会话标题",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "删除会话标题"
|
||||
},
|
||||
{
|
||||
"name": "查询会话标题",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"permission": "module_ai:chat_session:query",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "查询会话标题",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "查询会话标题"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "会话内容",
|
||||
"type": 2,
|
||||
"icon": "el-icon-ChatSquare",
|
||||
"order": 2,
|
||||
"permission": "module_ai:chat_message:query",
|
||||
"route_name": "ChatMessage",
|
||||
"route_path": "/ai/chat_message",
|
||||
"component_path": "module_ai/chat_message/index",
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话内容",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话内容",
|
||||
"children": [
|
||||
{
|
||||
"name": "会话消息详情",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 6,
|
||||
"permission": "module_ai:chat_message:detail",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话消息详情",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话消息详情"
|
||||
},
|
||||
{
|
||||
"name": "创建会话消息",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 7,
|
||||
"permission": "module_ai:chat_message:create",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "创建会话消息",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "创建会话消息"
|
||||
},
|
||||
{
|
||||
"name": "修改会话消息",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 8,
|
||||
"permission": "module_ai:chat_message:update",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "修改会话消息",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "修改会话消息"
|
||||
},
|
||||
{
|
||||
"name": "删除会话消息",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 9,
|
||||
"permission": "module_ai:chat_message:delete",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "删除会话消息",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "删除会话消息"
|
||||
},
|
||||
{
|
||||
"name": "查询会话消息",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
"permission": "module_ai:chat_message:query",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "查询会话消息",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "查询会话消息"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AI智能助手",
|
||||
"type": 2,
|
||||
"icon": "el-icon-ChatDotRound",
|
||||
"order": 3,
|
||||
"permission": "module_ai:chat:ws",
|
||||
"order": 1,
|
||||
"permission": "module_ai:chat:query",
|
||||
"route_name": "Chat",
|
||||
"route_path": "/application/ai",
|
||||
"route_path": "/ai/chat",
|
||||
"component_path": "module_ai/chat/index",
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
@@ -2569,6 +2337,179 @@
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "AI对话"
|
||||
},
|
||||
{
|
||||
"name": "查询会话",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 2,
|
||||
"permission": "module_ai:chat:query",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "查询会话",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "查询会话"
|
||||
},
|
||||
{
|
||||
"name": "会话详情",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 3,
|
||||
"permission": "module_ai:chat:detail",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话详情",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话详情"
|
||||
},
|
||||
{
|
||||
"name": "创建会话",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 4,
|
||||
"permission": "module_ai:chat:create",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "创建会话",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "创建会话"
|
||||
},
|
||||
{
|
||||
"name": "更新会话",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"permission": "module_ai:chat:update",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "更新会话",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "更新会话"
|
||||
},
|
||||
{
|
||||
"name": "删除会话",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 6,
|
||||
"permission": "module_ai:chat:delete",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "删除会话",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "删除会话"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "会话记忆",
|
||||
"type": 2,
|
||||
"icon": "el-icon-ChatLineSquare",
|
||||
"order": 2,
|
||||
"permission": "module_ai:chat:query",
|
||||
"route_name": "Memory",
|
||||
"route_path": "/ai/memory",
|
||||
"component_path": "module_ai/memory/index",
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话记忆",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话记忆管理",
|
||||
"children": [
|
||||
{
|
||||
"name": "查询会话记忆",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"permission": "module_ai:chat:query",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "查询会话记忆",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "查询会话记忆"
|
||||
},
|
||||
{
|
||||
"name": "会话记忆详情",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 2,
|
||||
"permission": "module_ai:chat:detail",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "会话记忆详情",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "会话记忆详情"
|
||||
},
|
||||
{
|
||||
"name": "删除会话记忆",
|
||||
"type": 3,
|
||||
"icon": null,
|
||||
"order": 3,
|
||||
"permission": "module_ai:chat:delete",
|
||||
"route_name": null,
|
||||
"route_path": null,
|
||||
"component_path": null,
|
||||
"status": "0",
|
||||
"keep_alive": true,
|
||||
"hidden": false,
|
||||
"always_show": false,
|
||||
"title": "删除会话记忆",
|
||||
"params": null,
|
||||
"affix": false,
|
||||
"redirect": null,
|
||||
"description": "删除会话记忆"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user