from flushai.integrations import DropboxLoader

Initialization

DropboxLoader requires you to create a Dropbox App and generate an access token. This can be done by going here and clicking “Create App”. After the app is created, go to the OAuth 2 section and generate an access token.

We additionally must specify the folder path that we aim to retrieve the images from.

access_token = "YOUR_ACCESS_TOKEN"
folder_path = "YOUR_FOLDER_PATH"

loader = DropboxLoader(
    access_token=access_token, 
    folder_path=folder_path
)

Retrieving Results

The load function can be used to retrieve results by passing in a prompt. By default, all images in the folder are retrieved, but you can pass in a custom number of images to retrieve with the num parameter.

loader.load(num=3)

An ImageGallery object is returned.