You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.6 KiB
37 lines
1.6 KiB
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text
|
|
from config.database import Base
|
|
from datetime import datetime
|
|
|
|
|
|
class AiChatHistory(Base):
|
|
"""
|
|
菜单权限表
|
|
"""
|
|
__tablename__ = 'ai_chat_history'
|
|
|
|
chat_id = Column(String(50), primary_key=True, comment='问答id')
|
|
session_id = Column(String(50), default='', comment='聊天记录id')
|
|
session_name = Column(String(50), default='', comment='聊天记录标题')
|
|
type = Column(String(50), default='', comment='类型,问题 or 回答')
|
|
is_end = Column(Boolean, default=None, comment='是否结束')
|
|
is_stop = Column(Boolean, default=None, comment='是否停止')
|
|
copy_text = Column(Text, default=None, comment='复制的内容')
|
|
user = Column(Integer, default=None, comment='所属用户')
|
|
time = Column(String(50), default=None, comment='问答时间')
|
|
content = Column(Text, default=None, comment='问答内容')
|
|
operate = Column(String(50), default=None, comment='点赞,差评等操作')
|
|
thumb_down_reason = Column(String(255), default=None, comment='差评原因')
|
|
file = Column(String(255), default=None, comment='文件id集合')
|
|
|
|
|
|
class AiChatSession(Base):
|
|
"""
|
|
菜单权限表
|
|
"""
|
|
__tablename__ = 'ai_chat_session'
|
|
|
|
session_id = Column(String(50), primary_key=True, comment='聊天记录id')
|
|
session_name = Column(String(50), default='', comment='聊天记录标题')
|
|
user = Column(Integer, default=None, comment='所属用户')
|
|
time = Column(String(50), default=None, comment='问答时间')
|
|
|
|
|