@@ -119,7 +119,8 @@ class Knowledge(AppModelMixin):
119119 workspace_id = models .CharField (max_length = 64 , verbose_name = "工作空间id" , default = "default" , db_index = True )
120120 desc = models .CharField (max_length = 256 , verbose_name = "描述" )
121121 user = models .ForeignKey (User , on_delete = models .SET_NULL , db_constraint = False , blank = True , null = True )
122- type = models .IntegerField (verbose_name = '类型' , choices = KnowledgeType .choices , default = KnowledgeType .BASE , db_index = True )
122+ type = models .IntegerField (verbose_name = '类型' , choices = KnowledgeType .choices , default = KnowledgeType .BASE ,
123+ db_index = True )
123124 scope = models .CharField (max_length = 20 , verbose_name = '可用范围' , choices = KnowledgeScope .choices ,
124125 default = KnowledgeScope .WORKSPACE , db_index = True )
125126 folder = models .ForeignKey (KnowledgeFolder , on_delete = models .DO_NOTHING , verbose_name = "文件夹id" , default = 'default' )
@@ -147,7 +148,8 @@ class Document(AppModelMixin):
147148 status = models .CharField (verbose_name = '状态' , max_length = 20 , default = get_default_status , db_index = True )
148149 status_meta = models .JSONField (verbose_name = "状态统计数据" , default = default_status_meta )
149150 is_active = models .BooleanField (default = True , db_index = True )
150- type = models .IntegerField (verbose_name = '类型' , choices = KnowledgeType .choices , default = KnowledgeType .BASE , db_index = True )
151+ type = models .IntegerField (verbose_name = '类型' , choices = KnowledgeType .choices , default = KnowledgeType .BASE ,
152+ db_index = True )
151153 hit_handling_method = models .CharField (verbose_name = '命中处理方式' , max_length = 20 ,
152154 choices = HitHandlingMethod .choices ,
153155 default = HitHandlingMethod .optimization )
@@ -226,6 +228,7 @@ class FileSourceType(models.TextChoices):
226228 DOCUMENT = "DOCUMENT"
227229 # 对话
228230 CHAT = "CHAT"
231+ SYSTEM = "SYSTEM"
229232 # 临时30分钟 数据30分钟后被清理 source_id 为TEMPORARY_30_MINUTE
230233 TEMPORARY_30_MINUTE = "TEMPORARY_30_MINUTE"
231234 # 临时120分钟 数据120分钟后被清理 source_id为TEMPORARY_100_MINUTE
@@ -263,7 +266,8 @@ class File(AppModelMixin):
263266 sha256_hash = models .CharField (verbose_name = "文件sha256_hash标识" , default = "" )
264267 source_type = models .CharField (verbose_name = "资源类型" , choices = FileSourceType ,
265268 default = FileSourceType .TEMPORARY_120_MINUTE .value , db_index = True )
266- source_id = models .CharField (verbose_name = "资源id" , default = FileSourceType .TEMPORARY_120_MINUTE .value , db_index = True )
269+ source_id = models .CharField (verbose_name = "资源id" , default = FileSourceType .TEMPORARY_120_MINUTE .value ,
270+ db_index = True )
267271 loid = models .IntegerField (verbose_name = "loid" )
268272 meta = models .JSONField (verbose_name = "文件关联数据" , default = dict )
269273
0 commit comments