Skip to content

Commit aba4939

Browse files
DirectoryReader: set text/plain as default mime type if it is not found (#513)
DirectoryReader: set text/plain as default mime type if it is not found. This is useful when parsing several markdown formats that don't have a mime type.
1 parent 7550865 commit aba4939

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apis/python/src/tiledb/vector_search/object_readers/directory_reader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ def lazy_load(
385385
mime_type = mimetypes.guess_type(self.uri)[0]
386386
f = vfs.open(self.uri)
387387

388+
if mime_type is None:
389+
mime_type = "text/plain"
390+
388391
if mime_type.startswith("image/"):
389392
from langchain_community.document_loaders import UnstructuredFileIOLoader
390393

0 commit comments

Comments
 (0)