Quickstart
Upload a document and run a query. All within minutes.
Get Token
Sign up at chat.activeloop.ai. Navigate to βοΈ β API tokens, and create a token. Set the token as ACTIVELOOP_TOKEN environment variable.
Upload Documents
We will fetch 4 reference guides from NASA each more than 90 pages and ask a highly complex question.
import os, io, requests
pdf_urls = ["https://www.nasa.gov/wp-content/uploads/2022/03/sls-reference-guide-2022-v2-508-0.pdf",
"https://www.nasa.gov/wp-content/uploads/2023/02/orion-reference-guide-111022.pdf",
"https://www.lpi.usra.edu/lunar/artemis/Artemis-I-Reference-Guide_NP-2022-03-3045-HQ.pdf",
"https://www.ulalaunch.com/docs/default-source/rockets/2023_vulcan_user_guide.pdf"]
files = [('file', (os.path.basename(url), io.BytesIO(requests.get(url).content))) for url in pdf_urls]
response = requests.post(
'https://api.activeloop.ai/files',
headers={"Authorization": f"Bearer {os.getenv('ACTIVELOOP_TOKEN')}"},
files=files
)
# Onced uploaded, it would take few minutes to indexYou can learn about the state by listing files.
Query Data
Once the data is indexed, you can run a query against it as if you are calling your LLM .
Last updated

