-
Notifications
You must be signed in to change notification settings - Fork 16.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Service (Drive v3 or Excel V4) added as a parameter #5147
Conversation
|
||
file = service.files().get(fileId=id, supportsAllDrives=True).execute() | ||
request = service.files().get_media(fileId=id) | ||
file = self._service().files().get(fileId=id, supportsAllDrives=True).execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do service = self._service()
and then use in both these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the pull request accordingly. To be noted that I have not been able to test it since I have a poetry installation error on uvtools which claims not to be available on a windows environment. Even though I cannot run the unit tests, I suspect they will fail since googleapiclient must be added to poetry.lock which is something I don't know how to do.
As a workaround to this pull request, I have the rather easy option to create temporary credentials.json and token.json files before calling the GoogleDriveLoader. So really I won't mind if you decide to reject this pull request for simplicity.
I very much enjoy discovering LLM and AI through LangChain and I appreciate it must be quite intense to monitor such a booming community. Thank you for driving this great project!
…removed from private definitions
…oader (doc, sheets, slides or file)
II have further improved this Pool request to add support to Slides and allow load_file_from_ids to check for the appropriate loader. |
cross-referencing: #5135 |
The pull request 5135 resolve this. |
#9999 resolves it. |
Modify GoogleDriveLoader so that it can accept a Google Service instead of relying on a path to credential files.
I am deploying LangChain in serverless environment where I use Redis for chat memory and security token store. This pull request allows to pass a Google Drive or a Google Sheet Service instead of a path to local files.
I would also consider moving _load_sheet_from_id into a different class than GoogleDriveLoader since it is not based on Google Drive API.
Dear @eyurtsev, please advise,