mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 22:15:10 +00:00
fix: handle non text uploads more carefully
This commit is contained in:
1 parent
82691314ca
commit
3030aba39d
21 files changed
+729
-40
No files matched your search
@@ -26,6 +26,17 @@ class DocumentParseError(Exception):
|
||||
"""
|
||||
|
||||
|
||||
class NoTextLayerError(DocumentParseError):
|
||||
"""A readable document with no text to extract, such as a scanned PDF.
|
||||
|
||||
Still a failed parse wherever text is the point (source ingestion needs
|
||||
something to embed), so it subclasses ``DocumentParseError`` and callers
|
||||
that do not know about it keep failing loudly. The file itself is intact,
|
||||
though: a chat attachment can still go to a model that reads the format
|
||||
natively, which is why the attachment worker catches this type.
|
||||
"""
|
||||
|
||||
|
||||
class BaseParser:
|
||||
"""Base class for all parsers."""
|
||||
|
||||
|
||||
Reference in new issue
Block a user