| 64 | # TODO choose table / check connection / generate description |
| 65 | |
| 66 | class ChatLog(SQLModel, table=True): |
| 67 | __tablename__ = "chat_log" |
| 68 | id: Optional[int] = Field(sa_column=Column(BigInteger, Identity(always=True), primary_key=True)) |
| 69 | type: TypeEnum = Field( |
| 70 | sa_column=Column(SQLAlchemyEnum(TypeEnum, native_enum=False, values_callable=enum_values, length=3))) |
| 71 | operate: OperationEnum = Field( |
| 72 | sa_column=Column(SQLAlchemyEnum(OperationEnum, native_enum=False, values_callable=enum_values, length=3))) |
| 73 | pid: Optional[int] = Field(sa_column=Column(BigInteger, nullable=True)) |
| 74 | ai_modal_id: Optional[int] = Field(sa_column=Column(BigInteger)) |
| 75 | base_modal: Optional[str] = Field(max_length=255) |
| 76 | messages: Optional[list[dict]] = Field(sa_column=Column(JSONB)) |
| 77 | reasoning_content: Optional[str | None] = Field(sa_column=Column(Text, nullable=True)) |
| 78 | start_time: datetime = Field(sa_column=Column(DateTime(timezone=False), nullable=True)) |
| 79 | finish_time: datetime = Field(sa_column=Column(DateTime(timezone=False), nullable=True)) |
| 80 | token_usage: Optional[dict | None | int] = Field(sa_column=Column(JSONB)) |
| 81 | local_operation: bool = Field(default=False) |
| 82 | error: bool = Field(default=False) |
| 83 | |
| 84 | |
| 85 | class Chat(SQLModel, table=True): |
no test coverage detected