21f9839dd6
- 后端实现: - 添加 ai_chat_conversations 和 ai_chat_messages 数据模型 - 创建 AI 问答 API 路由(/api/v1/ai-chat) - 实现对话管理和消息发送服务 - 集成 OpenAI API 进行对话交互 - 支持流式对话历史和上下文管理 - 前端实现: - 创建 ChatGPT 风格的聊天界面(/admin/ai-chat) - 支持新建、选择、删除对话 - 实现消息发送和实时显示 - 使用 Ant Design 组件构建响应式 UI - 系统参数配置: - ai_chat.openai_api_key: OpenAI API 密钥 - ai_chat.model: 使用的 AI 模型(默认 gpt-3.5-turbo) - ai_chat.base_url: API 基础 URL(支持第三方兼容接口) - 数据库迁移: - 002_add_ai_chat.sql: 创建对话和消息表 - 003_add_ai_chat_params.sql: 添加系统参数默认配置 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
34 lines
901 B
Python
34 lines
901 B
Python
"""Database model package.
|
|
|
|
Import all model modules during package initialization so SQLAlchemy can
|
|
resolve string-based relationships regardless of route/service import order.
|
|
"""
|
|
|
|
from . import ai_chat, atp_asset, atp_model, audit_log, auth_session, elevation, file_storage, fl_analysis, lightning_event, lightning_sample, line, line_tower, menu, object_group, rbac, scheduled_task, system_message, system_param, tower_model, tower_profile, user, wine, worker_registry
|
|
|
|
__all__ = [
|
|
"ai_chat",
|
|
"atp_asset",
|
|
"atp_model",
|
|
"audit_log",
|
|
"auth_session",
|
|
"elevation",
|
|
"file_storage",
|
|
"fl_analysis",
|
|
"lightning_event",
|
|
"lightning_sample",
|
|
"line",
|
|
"line_tower",
|
|
"menu",
|
|
"object_group",
|
|
"rbac",
|
|
"scheduled_task",
|
|
"system_message",
|
|
"system_param",
|
|
"tower_model",
|
|
"tower_profile",
|
|
"user",
|
|
"wine",
|
|
"worker_registry",
|
|
]
|