feat(ai): Phase 3A RAG 知识库 — CRUD API + Agent Tool + 向量知识源 + 前端管理页
- 知识库 REST API: 10 个端点 (references/guides CRUD + re-embed) - search_medical_knowledge Agent Tool: 语义检索参考资料和临床指南 - VectorKnowledgeSource: 实现 KnowledgeSource trait,自动降级 - 沙箱配置: Patient/MedicalStaff 允许使用知识库检索 - 前端 AiKnowledgePage: Tabs(参考资料/临床指南) + Table + Modal CRUD - 权限码 seed 迁移: ai.knowledge.list + ai.knowledge.manage + 菜单
This commit is contained in:
@@ -10,7 +10,7 @@ use crate::service::embedding::{EmbeddingService, format_vector};
|
||||
|
||||
// ─── DTO ───
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize, utoipa::ToSchema)]
|
||||
pub struct CreateKnowledgeReferenceReq {
|
||||
pub title: String,
|
||||
pub analysis_type: String,
|
||||
@@ -20,7 +20,7 @@ pub struct CreateKnowledgeReferenceReq {
|
||||
pub is_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize, utoipa::ToSchema)]
|
||||
pub struct UpdateKnowledgeReferenceReq {
|
||||
pub title: Option<String>,
|
||||
pub analysis_type: Option<String>,
|
||||
@@ -30,7 +30,7 @@ pub struct UpdateKnowledgeReferenceReq {
|
||||
pub is_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize, utoipa::ToSchema)]
|
||||
pub struct CreateKnowledgeGuideReq {
|
||||
pub title: String,
|
||||
pub analysis_type: String,
|
||||
@@ -39,7 +39,7 @@ pub struct CreateKnowledgeGuideReq {
|
||||
pub is_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize, utoipa::ToSchema)]
|
||||
pub struct UpdateKnowledgeGuideReq {
|
||||
pub title: Option<String>,
|
||||
pub analysis_type: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user