knowledge_base.go 635 B

12345678910111213141516
  1. package models
  2. import (
  3. "time"
  4. )
  5. // KnowledgeBase 知识库模型
  6. type KnowledgeBase struct {
  7. ID uint `json:"id" gorm:"primarykey"`
  8. Name string `json:"name" gorm:"type:varchar(255);not null"`
  9. Description string `json:"description" gorm:"type:text"`
  10. DocumentCount int `json:"document_count" gorm:"default:0"` // 文档数量(缓存字段)
  11. RAGEnabled bool `json:"rag_enabled" gorm:"default:true"` // 是否参与 RAG:开启时该知识库下的已发布文档会被 AI 引用
  12. CreatedAt time.Time `json:"created_at"`
  13. UpdatedAt time.Time `json:"updated_at"`
  14. }