mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
将AI模块从module_application迁移到module_ai目录 新增聊天会话和消息的CRUD、服务和控制器 实现WebSocket聊天接口和前端组件 优化代码结构和性能,修复已知问题
17 lines
489 B
Python
17 lines
489 B
Python
from sqlalchemy import String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.base_model import ModelMixin, UserMixin
|
|
|
|
|
|
class ChatSessionModel(ModelMixin, UserMixin):
|
|
"""
|
|
聊天会话表
|
|
"""
|
|
|
|
__tablename__: str = "ai_chat_session"
|
|
__table_args__: dict[str, str] = {"comment": "聊天会话表"}
|
|
__loader_options__: list[str] = ["created_by", "updated_by"]
|
|
|
|
title: Mapped[str] = mapped_column(String(200), nullable=False, comment="会话标题")
|