[Feature] Add Dropbox loader (#1073)

Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
This commit is contained in:
Sidharth Mohanty
2023-12-29 23:22:25 +05:30
committed by GitHub
parent a544b4d3ff
commit 404e73af77
9 changed files with 251 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
---
title: '💾 Dropbox'
---
To load folders or files from your Dropbox account, configure the `data_type` parameter as `dropbox` and specify the path to the desired file or folder, starting from the root directory of your Dropbox account.
For Dropbox access, an **access token** is required. Obtain this token by visiting [Dropbox Developer Apps](https://www.dropbox.com/developers/apps). There, create a new app and generate an access token for it.
Ensure your app has the following settings activated:
- In the Permissions section, enable `files.content.read` and `files.metadata.read`.
```python
import os
from embedchain import Pipeline as App
os.environ["DROPBOX_ACCESS_TOKEN"] = "sl.xxx"
os.environ["OPENAI_API_KEY"] = "sk-xxx"
app = App()
# any path from the root of your dropbox account, you can leave it "" for the root folder
app.add("/test", data_type="dropbox")
print(app.query("Which two celebrities are mentioned here?"))
# The two celebrities mentioned in the given context are Elon Musk and Jeff Bezos.
```

View File

@@ -31,6 +31,7 @@ Embedchain comes with built-in support for various data sources. We handle the c
<Card title="📝 Substack" href="/components/data-sources/substack"></Card>
<Card title="🐝 Beehiiv" href="/components/data-sources/beehiiv"></Card>
<Card title="📁 Directory" href="/components/data-sources/directory"></Card>
<Card title="💾 Dropbox" href="/components/data-sources/dropbox"></Card>
</CardGroup>
<br/ >