Skip to main content
Open In ColabOpen on GitHub

Tigris Directory

Tigris is a globally distributed object storage service, allowing your files to load fast anywhere in the world.

This covers how to load document objects from an AWS S3 Directory object via Tigris.

%pip install --upgrade --quiet  boto3
from langchain_community.document_loaders import S3DirectoryLoader
loader = S3DirectoryLoader(
"testing-hwc", # put your bucket name here
aws_access_key_id="tid_access_key_id", # put your access key ID here
aws_secret_access_key="tsec_secret_access_key", # put your secret access key here
region="auto",
endpoint_url="https://t3.storage.dev",
)
loader.load()

Specifying a prefix

You can also specify a prefix for more fine-grained control over what files to load.

loader = S3DirectoryLoader("testing-hwc", prefix="fake")
loader.load()
[Document(page_content='Lorem ipsum dolor sit amet.', lookup_str='', metadata={'source': 's3://testing-hwc/fake.docx'}, lookup_index=0)]