community[minor]: Add support for non-file-based Document Loaders in PebbloSafeLoader (#19574)

**Description:**
PebbloSafeLoader: Add support for non-file-based Document Loaders

This pull request enhances PebbloSafeLoader by introducing support for
several non-file-based Document Loaders. With this update,
PebbloSafeLoader now seamlessly integrates with the following loaders:
- GoogleDriveLoader
- SlackDirectoryLoader
- Unstructured EmailLoader

**Issue:** NA
**Dependencies:** - None
**Twitter handle:** @Raj__725

---------

Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
This commit is contained in:
Rajendra Kadam
2024-03-27 23:09:52 +05:30
committed by GitHub
parent 9954c6a38e
commit 0019d8a948
2 changed files with 36 additions and 6 deletions

View File

@@ -125,7 +125,9 @@ class PebbloSafeLoader(BaseLoader):
doc_content = [doc.dict() for doc in self.docs]
docs = []
for doc in doc_content:
doc_source_path = get_full_path(doc.get("metadata", {}).get("source"))
doc_source_path = get_full_path(
doc.get("metadata", {}).get("source", self.source_path)
)
doc_source_owner = PebbloSafeLoader.get_file_owner_from_path(
doc_source_path
)