To align with other APIs such as VertexAI and VertexModelGarden, it may be useful in some cases to pass google.auth.Credentials directly to the GoogleDriveLoader constructor instead of passing the service account file.
It should provide more flexibility. It should not change the other log in features.
Proposed solution:
Instantiate the credentials in the GoogleDriveLoader attributes. Replace the credentials calls with an attribute reference.
I would be happy to contribute if you validate this feature.
from google.auth.credentials import Credentials
class GoogleDriveLoader(BaseLoader, BaseModel):
"""Load Google Docs from `Google Drive`."""
credentials : Credentials | None
Description:
To align with other APIs such as VertexAI and VertexModelGarden, it may be useful in some cases to pass google.auth.Credentials directly to the GoogleDriveLoader constructor instead of passing the service account file.
It should provide more flexibility. It should not change the other log in features.
Proposed solution: Instantiate the credentials in the GoogleDriveLoader attributes. Replace the credentials calls with an attribute reference.
I would be happy to contribute if you validate this feature.
Reference: https://github.com/langchain-ai/langchain-google/blob/3c9efa1741431e44b0a9b061ba18a4bc51e137a9/libs/community/langchain_google_community/drive.py#L21C7-L21C24