-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
文本分段与清洗失败 #2549
Comments
🤖 你好,@limuan123123!很高兴再次见到你。👋😊 根据您提供的错误信息,问题可能出在 要解决这个问题,您应该确保 以下是如何添加类型检查的示例: document = DocumentService.get_document(dataset.id, document_id)
if not document:
raise NotFound('Document not found.')
if not isinstance(document, Document):
raise TypeError('Expected a Document object, but got a different type.') 请将 另外,关于
这是 class Document(BaseModel):
"""Class for storing a piece of text and associated metadata."""
page_content: str
"""Arbitrary metadata about the page content (e.g., source, relationships to other
documents, etc.).
"""
metadata: Optional[dict] = Field(default_factory=dict) 希望这些信息能帮助您解决问题。如果还有其他问题,欢迎继续提问。 Sources
|
Self Checks
Provide a description of the help you need
文本分段与清洗上传文档成功,文本分段与清洗失败。
Traceback (most recent call last):
File "/usr/local/dify/api/core/indexing_runner.py", line 67, in run
self._load_segments(dataset, dataset_document, documents)
File "/usr/local/dify/api/core/indexing_runner.py", line 782, in _load_segments
doc_store.add_documents(documents)
File "/usr/local/dify/api/core/docstore/dataset_docstore.py", line 85, in add_documents
raise ValueError("doc must be a Document")
ValueError: doc must be a Document
The text was updated successfully, but these errors were encountered: