Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for field errors and missing fields in SQLAlchemy model '__repr__(SQLAlchemy模型字符串表示方法中的字段错误&字段缺失) #5075

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class KnowledgeBaseModel(Base):
create_time = Column(DateTime, default=func.now(), comment="创建时间")

def __repr__(self):
return f"<KnowledgeBase(id='{self.id}', kb_name='{self.kb_name}',kb_intro='{self.kb_info} vs_type='{self.vs_type}', embed_model='{self.embed_model}', file_count='{self.file_count}', create_time='{self.create_time}')>"
return f"<KnowledgeBase(id='{self.id}', kb_name='{self.kb_name}',kb_info='{self.kb_info} vs_type='{self.vs_type}', embed_model='{self.embed_model}', file_count='{self.file_count}', create_time='{self.create_time}')>"


# 创建一个对应的 Pydantic 模型
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class KnowledgeFileModel(Base):
create_time = Column(DateTime, default=func.now(), comment="创建时间")

def __repr__(self):
return f"<KnowledgeFile(id='{self.id}', file_name='{self.file_name}', file_ext='{self.file_ext}', kb_name='{self.kb_name}', document_loader_name='{self.document_loader_name}', text_splitter_name='{self.text_splitter_name}', file_version='{self.file_version}', create_time='{self.create_time}')>"
return (f"<KnowledgeFile(id='{self.id}', file_name='{self.file_name}', file_ext='{self.file_ext}', kb_name='{self.kb_name}',"
f" document_loader_name='{self.document_loader_name}', text_splitter_name='{self.text_splitter_name}', "
f" file_version='{self.file_version}', file_mtime='{self.file_mtime}', file_size='{self.file_size}',"
f" custom_docs='{self.custom_docs}', docs_count='{self.docs_count}', create_time='{self.create_time}')>")


class FileDocModel(Base):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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中
Expand All @@ -27,5 +27,5 @@ class SummaryChunkModel(Base):
def __repr__(self):
return (
f"<SummaryChunk(id='{self.id}', kb_name='{self.kb_name}', summary_context='{self.summary_context}',"
f" doc_ids='{self.doc_ids}', metadata='{self.metadata}')>"
f" summary_id='{self.summary_id}', doc_ids='{self.doc_ids}', metadata='{self.metadata}')>"
)