-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add Dropbox Document Loader #7301
base: main
Are you sure you want to change the base?
Add Dropbox Document Loader #7301
Conversation
…n-ath/langchainjs into add-dropbox-document-loader
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Hi @jacoblee93, Can you take a look at this PR? I'd appreciate your feedback. |
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.
Sorry about the delay!
accessToken: "your-dropbox-access-token", | ||
}, | ||
unstructuredOptions: { | ||
apiUrl: "http://localhost:8000/general/v0/general", // Replace with your Unstructured API URL |
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.
Let's emphasize somewhere that this wraps Unstructured
Should we call this DropboxUnstructuredLoader
instead?
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.
Yes, we can rename the loader class to DropboxUnstructuredLoader
I want to confirm if I need to rename the file to say dropbox_unstructured.ts
as well?
Also, I noticed that a few preexisting loaders utilize unstructured as well. Would they need to be renamed as well in the future?:
console.log(docs[0].pageContent); | ||
``` | ||
|
||
## Configuration Options |
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.
Just link to API refs instead
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.
Is this fine? dccce35
/** | ||
* The file system module to use. Defaults to Node's `fs` module. | ||
*/ | ||
fs?: typeof fsDefault; |
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.
Why do we need fs
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 was thinking that a consumer might want to pass their own instance of fs to control where downloaded assets are stored in the interim before being sent out to Unstructured.
However by 7027578 the fs option is redundant and has been removed.
|
||
await fsPromises.mkdir(path.dirname(localFilePath), { recursive: true }); | ||
|
||
await fsPromises.writeFile(localFilePath, fileBinary, { |
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.
Would be nice to not need to use the file system
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.
Updated to not use the file system 7027578
This PR introduces support for the Dropbox Document Loader.
This is our first contribution to Langchain. I'd appreciate any feedback and suggestions for this PR.
Fixes #7031