Replies: 2 comments 1 reply
-
🤖 Hey @Defozo! Nice to see you here again. Hope you're doing well! Based on the error message you're receiving, it seems like you're trying to download a Google Docs or Sheets file as a binary file, which is not supported by the Google Drive API. Google Docs and Sheets are web-based documents that do not have a binary representation that can be downloaded directly. In the LangChain's GoogleDriveLoader, the method For Google Docs and Sheets, you need to use the So, if you are trying to process a folder with a mix of files and Google Docs/Sheets, make sure that the correct method is used for each file type. The I also found a similar issue in the LangChain repository: Document Loaders: GoogleDriveLoader can't load a google docs file.. The solution suggested there is to split your documents either as Google docs or not based on their mimeType, and then feed your documents ids to GoogleDriveLoader(
file_ids=non_google_file_to_load,
document_ids=google_file_to_load,
credentials_path=credentials_path / "credentials.json",
token_path=credentials_path / "token.json",
file_loader_cls=UnstructuredFileIOLoader,
file_loader_kwargs={"mode": "single"}
) I hope this helps! If you have any other questions, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
I've been fighting with this too and the only way I can get it to work is by using this,
However, that is deprecated. These do not work,
or
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I'm following the documentation here:
https://python.langchain.com/docs/integrations/document_loaders/google_drive
It says:
But when I use the code provided:
I'm getting error:
(I removed ids with
...
)I'd expect this to load the Google Spreadsheet I'm trying to load here without any errors.
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
Beta Was this translation helpful? Give feedback.
All reactions