40 lines
1.3 KiB
Rust
40 lines
1.3 KiB
Rust
use crate::{DateTimeUtc, ProjectId, UserId};
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, DeriveEntityModel)]
|
|
#[sea_orm(table_name = "ai_conversation")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: Uuid,
|
|
pub user_id: UserId,
|
|
pub project_id: Option<ProjectId>,
|
|
pub scope: String,
|
|
pub title: Option<String>,
|
|
pub model: String,
|
|
pub model_config: Option<Json>,
|
|
pub status: String,
|
|
pub root_message_id: Option<Uuid>,
|
|
pub fork_count: i32,
|
|
pub is_shared: bool,
|
|
pub message_count: i32,
|
|
pub token_usage_total: Option<i32>,
|
|
/// Who can see this chat: "owner" | "admin" | "member"
|
|
pub access_visibility: String,
|
|
/// Who can send messages: "owner" | "admin" | "member"
|
|
pub can_ask: String,
|
|
/// Project-unique sequential number for this chat
|
|
pub project_uid: Option<i32>,
|
|
/// AI model UUID selected for this chat
|
|
pub model_uid: Option<Uuid>,
|
|
/// AI model display name (e.g. "Claude Sonnet 4")
|
|
pub model_name: Option<String>,
|
|
pub created_at: DateTimeUtc,
|
|
pub updated_at: DateTimeUtc,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|