mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-30 15:21:02 +00:00
feat(ChatExcel): ChatExcel example file
add example excel file use to test ChatExcel
This commit is contained in:
parent
3c58431e86
commit
b42a77465b
@ -9,7 +9,10 @@ from pilot.base_modules.meta_data.meta_data import Base, engine, session
|
||||
|
||||
class MyPluginEntity(Base):
|
||||
__tablename__ = "my_plugin"
|
||||
|
||||
__table_args__ = {
|
||||
"mysql_charset": "utf8mb4",
|
||||
"mysql_collate": "utf8mb4_unicode_ci",
|
||||
}
|
||||
id = Column(Integer, primary_key=True, comment="autoincrement id")
|
||||
tenant = Column(String(255), nullable=True, comment="user's tenant")
|
||||
user_code = Column(String(255), nullable=False, comment="user code")
|
||||
@ -27,7 +30,7 @@ class MyPluginEntity(Base):
|
||||
created_at = Column(
|
||||
DateTime, default=datetime.utcnow, comment="plugin install time"
|
||||
)
|
||||
__table_args__ = (UniqueConstraint("user_code", "name", name="uk_name"),)
|
||||
UniqueConstraint("user_code", "name", name="uk_name")
|
||||
|
||||
|
||||
class MyPluginDao(BaseDao[MyPluginEntity]):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
from typing import List
|
||||
from sqlalchemy import Column, Integer, String, Index, DateTime, func, Boolean
|
||||
from sqlalchemy import Column, Integer, String, Index, DateTime, func, Boolean, DDL
|
||||
from sqlalchemy import UniqueConstraint
|
||||
from pilot.base_modules.meta_data.meta_data import Base
|
||||
|
||||
@ -9,8 +9,13 @@ from pilot.base_modules.meta_data.base_dao import BaseDao
|
||||
from pilot.base_modules.meta_data.meta_data import Base, engine, session
|
||||
|
||||
|
||||
char_set_sql = DDL("ALTER TABLE plugin_hub CONVERT TO CHARACTER SET utf8mb4")
|
||||
class PluginHubEntity(Base):
|
||||
__tablename__ = "plugin_hub"
|
||||
__table_args__ = {
|
||||
"mysql_charset": "utf8mb4",
|
||||
"mysql_collate": "utf8mb4_unicode_ci",
|
||||
}
|
||||
id = Column(
|
||||
Integer, primary_key=True, autoincrement=True, comment="autoincrement id"
|
||||
)
|
||||
@ -26,10 +31,9 @@ class PluginHubEntity(Base):
|
||||
created_at = Column(DateTime, default=datetime.utcnow, comment="plugin upload time")
|
||||
installed = Column(Integer, default=False, comment="plugin already installed count")
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name", name="uk_name"),
|
||||
Index("idx_q_type", "type"),
|
||||
)
|
||||
UniqueConstraint("name", name="uk_name")
|
||||
Index("idx_q_type", "type")
|
||||
|
||||
|
||||
|
||||
class PluginHubDao(BaseDao[PluginHubEntity]):
|
||||
|
@ -10,6 +10,10 @@ class ChatHistoryEntity(Base):
|
||||
id = Column(
|
||||
Integer, primary_key=True, autoincrement=True, comment="autoincrement id"
|
||||
)
|
||||
__table_args__ = {
|
||||
"mysql_charset": "utf8mb4",
|
||||
"mysql_collate": "utf8mb4_unicode_ci",
|
||||
}
|
||||
conv_uid = Column(
|
||||
String(255),
|
||||
unique=False,
|
||||
@ -21,12 +25,11 @@ class ChatHistoryEntity(Base):
|
||||
user_name = Column(String(255), nullable=True, comment="interlocutor")
|
||||
messages = Column(Text, nullable=True, comment="Conversation details")
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint("conv_uid", name="uk_conversation"),
|
||||
Index("idx_q_user", "user_name"),
|
||||
Index("idx_q_mode", "chat_mode"),
|
||||
Index("idx_q_conv", "summary"),
|
||||
)
|
||||
UniqueConstraint("conv_uid", name="uk_conversation")
|
||||
Index("idx_q_user", "user_name")
|
||||
Index("idx_q_mode", "chat_mode")
|
||||
Index("idx_q_conv", "summary")
|
||||
|
||||
|
||||
|
||||
class ChatHistoryDao(BaseDao[ChatHistoryEntity]):
|
||||
|
Loading…
Reference in New Issue
Block a user