document_chunk.go 617 B

123456789101112131415
  1. package models
  2. import "time"
  3. // DocumentChunk 文档分段
  4. type DocumentChunk struct {
  5. ID uint `gorm:"primarykey" json:"id"`
  6. DocumentID uint `gorm:"index;not null" json:"document_id"`
  7. KnowledgeBaseID uint `gorm:"index;not null" json:"knowledge_base_id"`
  8. ChunkIndex int `gorm:"not null" json:"chunk_index"`
  9. Content string `gorm:"type:text;not null" json:"content"`
  10. EmbeddingStatus string `gorm:"type:varchar(20);default:'pending'" json:"embedding_status"`
  11. CreatedAt time.Time `json:"created_at"`
  12. UpdatedAt time.Time `json:"updated_at"`
  13. }