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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,6 +317,8 @@ class GoogleDriveLoader(BaseLoader, BaseModel):
docs = loader.load()
for doc in docs:
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
else: