Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
fix: credentials path and readme improvement (#567)
Browse files Browse the repository at this point in the history
fix: credentials path and readme improvement
  • Loading branch information
EmanuelCampos authored Oct 6, 2023
1 parent c266c8c commit 91e4a7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Unreleased

### New Features

### Smaller Features + Bug Fixes
- fix: credentials path and readme improvement (#567)

### [v0.0.35] - 2023-10-05
- Loader for Macrometa GDN (#484)
- adding boto3 minio doc loader (#497)
Expand Down
8 changes: 5 additions & 3 deletions llama_hub/google_drive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ You can also filter the files by the mimeType e.g.: `mime_types=["application/vn

## Usage

We need `credentials.json` and `client_secrets.json` files to use this reader.
We need `credentials.json` file to use this reader.

1. You need to get your `credentials.json` file by following the steps mentioned [here](https://developers.google.com/drive/api/v3/quickstart/python)
2. Create duplicate file of `credentials.json` with name `client_secrets.json` which will be used by pydrive for downloading files.
1. You need to create a service account folllowing the steps mentioned [here](https://cloud.google.com/iam/docs/keys-create-delete)
2. Get your json file and rename to `credentials.json` and move to the project root

> Note: If you are not using Google Workspaces (formerly GSuite), You'll need to share your document making it public, or inviting your service account as an reader/editor of the folder or file.
Finally, make sure you enable "Google Drive API" in the console of your Google App.

Expand Down
4 changes: 2 additions & 2 deletions llama_hub/google_drive/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def _get_credentials(self) -> Any:
creds = None
if os.path.exists(self.token_path):
creds = Credentials.from_authorized_user_file(self.token_path, SCOPES)
elif os.path.exists(self.service_account_path):
elif os.path.exists(self.credentials_path):
creds = service_account.Credentials.from_service_account_file(
self.service_account_path, scopes=SCOPES
self.credentials_path, scopes=SCOPES
)
gauth = GoogleAuth()
gauth.credentials = creds
Expand Down

0 comments on commit 91e4a7a

Please sign in to comment.