From b4ae257e21a221310fd6d0b2b0f8a4ff787cc77c Mon Sep 17 00:00:00 2001 From: jiaoja Date: Tue, 12 Nov 2024 15:36:25 +0800 Subject: [PATCH] Fixes for field errors and missing fields in SQLAlchemy model '__repr__' methods --- .../chatchat/server/db/models/knowledge_base_model.py | 2 +- .../chatchat/server/db/models/knowledge_file_model.py | 5 ++++- .../chatchat/server/db/models/knowledge_metadata_model.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/chatchat-server/chatchat/server/db/models/knowledge_base_model.py b/libs/chatchat-server/chatchat/server/db/models/knowledge_base_model.py index 1ef7f0aa18..dd8c6a2714 100644 --- a/libs/chatchat-server/chatchat/server/db/models/knowledge_base_model.py +++ b/libs/chatchat-server/chatchat/server/db/models/knowledge_base_model.py @@ -22,7 +22,7 @@ class KnowledgeBaseModel(Base): create_time = Column(DateTime, default=func.now(), comment="创建时间") def __repr__(self): - return f"" + return f"" # 创建一个对应的 Pydantic 模型 diff --git a/libs/chatchat-server/chatchat/server/db/models/knowledge_file_model.py b/libs/chatchat-server/chatchat/server/db/models/knowledge_file_model.py index 67fdff27ea..101b7ba247 100644 --- a/libs/chatchat-server/chatchat/server/db/models/knowledge_file_model.py +++ b/libs/chatchat-server/chatchat/server/db/models/knowledge_file_model.py @@ -23,7 +23,10 @@ class KnowledgeFileModel(Base): create_time = Column(DateTime, default=func.now(), comment="创建时间") def __repr__(self): - return f"" + return (f"") class FileDocModel(Base): diff --git a/libs/chatchat-server/chatchat/server/db/models/knowledge_metadata_model.py b/libs/chatchat-server/chatchat/server/db/models/knowledge_metadata_model.py index 3f4b982a83..f0f38639ae 100644 --- a/libs/chatchat-server/chatchat/server/db/models/knowledge_metadata_model.py +++ b/libs/chatchat-server/chatchat/server/db/models/knowledge_metadata_model.py @@ -5,7 +5,7 @@ class SummaryChunkModel(Base): """ - chunk summary模型,用于存储file_doc中每个doc_id的chunk 片段, + chunk summary模型,用于存储file_doc中每个doc_id的chunk片段, 数据来源: 用户输入: 用户上传文件,可填写文件的描述,生成的file_doc中的doc_id,存入summary_chunk中 程序自动切分 对file_doc表meta_data字段信息中存储的页码信息,按每页的页码切分,自定义prompt生成总结文本,将对应页码关联的doc_id存入summary_chunk中 @@ -27,5 +27,5 @@ class SummaryChunkModel(Base): def __repr__(self): return ( f"" + f" summary_id='{self.summary_id}', doc_ids='{self.doc_ids}', metadata='{self.metadata}')>" )