from sqlmodel import SQLModel

from .engine import engine
from .model_aii import AiiModel, AiiModelPublic, AiiProvider, AiiProviderPublic, z_aii_model, z_aii_provider
from .model_story import (
    Chatroom,
    ChatroomChat,
    ChatroomChatAccept,
    ChatroomChatDelete,
    ChatroomChatEdit,
    ChatroomPublic,
    ChatScript,
    ScriptTemplate,
)
from .model_user import ModelUploadFile, ModelUser
from .session import async_get_session, get_session


# 创建数据库连接和数据库文件
def create_db() -> None:  # noqa: RUF067
    SQLModel.metadata.create_all(engine)


__all__ = [
    AiiModel,
    AiiModelPublic,
    AiiProvider,
    AiiProviderPublic,
    ChatScript,
    Chatroom,
    ChatroomChat,
    ChatroomChatAccept,
    ChatroomChatDelete,
    ChatroomChatEdit,
    ChatroomPublic,
    ModelUploadFile,
    ModelUser,
    ScriptTemplate,
    async_get_session,
    create_db,
    get_session,
    z_aii_model,
    z_aii_provider,
]
