IMPROVEMENT: Added title metadata to GoogleDriveLoader for optional File Loaders (#13832)

- **Description:** Simple change, I just added title metadata to
GoogleDriveLoader for optional File Loaders
  - **Dependencies:** no dependencies
  - **Tag maintainer:** @hwchase17

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
raelix
2023-11-25 03:53:55 +01:00
committed by GitHub
parent 19c68c7652
commit c172605ea6

View File

@@ -317,6 +317,8 @@ class GoogleDriveLoader(BaseLoader, BaseModel):
docs = loader.load() docs = loader.load()
for doc in docs: for doc in docs:
doc.metadata["source"] = f"https://drive.google.com/file/d/{id}/view" doc.metadata["source"] = f"https://drive.google.com/file/d/{id}/view"
if "title" not in doc.metadata:
doc.metadata["title"] = f"{file.get('name')}"
return docs return docs
else: else: