chore: checkpoint ai search comments and i18n foundation
This commit is contained in:
28
backend/src/models/_entities/ai_chunks.rs
Normal file
28
backend/src/models/_entities/ai_chunks.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
//! `SeaORM` Entity, manually maintained
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "ai_chunks")]
|
||||
pub struct Model {
|
||||
pub created_at: DateTimeWithTimeZone,
|
||||
pub updated_at: DateTimeWithTimeZone,
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub source_slug: String,
|
||||
pub source_title: Option<String>,
|
||||
pub source_path: Option<String>,
|
||||
pub source_type: String,
|
||||
pub chunk_index: i32,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub content: String,
|
||||
pub content_preview: Option<String>,
|
||||
pub embedding: Option<String>,
|
||||
pub word_count: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -17,7 +17,11 @@ pub struct Model {
|
||||
pub avatar: Option<String>,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub content: Option<String>,
|
||||
pub scope: String,
|
||||
pub paragraph_key: Option<String>,
|
||||
pub paragraph_excerpt: Option<String>,
|
||||
pub reply_to: Option<Uuid>,
|
||||
pub reply_to_comment_id: Option<i32>,
|
||||
pub approved: Option<bool>,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.10
|
||||
|
||||
pub mod ai_chunks;
|
||||
pub mod prelude;
|
||||
|
||||
pub mod categories;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.10
|
||||
|
||||
pub use super::ai_chunks::Entity as AiChunks;
|
||||
pub use super::categories::Entity as Categories;
|
||||
pub use super::comments::Entity as Comments;
|
||||
pub use super::friend_links::Entity as FriendLinks;
|
||||
|
||||
@@ -28,6 +28,18 @@ pub struct Model {
|
||||
pub location: Option<String>,
|
||||
#[sea_orm(column_type = "JsonBinary", nullable)]
|
||||
pub tech_stack: Option<Json>,
|
||||
pub ai_enabled: Option<bool>,
|
||||
pub ai_provider: Option<String>,
|
||||
pub ai_api_base: Option<String>,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub ai_api_key: Option<String>,
|
||||
pub ai_chat_model: Option<String>,
|
||||
pub ai_embedding_model: Option<String>,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub ai_system_prompt: Option<String>,
|
||||
pub ai_top_k: Option<i32>,
|
||||
pub ai_chunk_size: Option<i32>,
|
||||
pub ai_last_indexed_at: Option<DateTimeWithTimeZone>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
||||
3
backend/src/models/ai_chunks.rs
Normal file
3
backend/src/models/ai_chunks.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub use super::_entities::ai_chunks::{ActiveModel, Entity, Model};
|
||||
|
||||
pub type AiChunks = Entity;
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod _entities;
|
||||
pub mod ai_chunks;
|
||||
pub mod categories;
|
||||
pub mod comments;
|
||||
pub mod friend_links;
|
||||
|
||||
Reference in New Issue
Block a user