amorriscode / stripe-docs-reader-demo

A demo implementation of the StripeDocsReader LlamaIndex loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StripeDocsLoader Demo

This repo contains an example of using the LlamaIndex StripeDocsReader. This loader iterates through Stripe's sitemap and consumes all of the documentation allowing users to create embeddings from them and then do RAG on those embeddings.

Note: This demo is likely not better than GPT. The RAG approach does not utilize any of the customization that LlamaIndex provides. GPT is also already trained on this content.

Set up

  1. Install dependencies
pip install -r requirements.txt
  1. Set up your .env file
cp ./.env.example ./.env
  1. Add your Open AI API key to your .env

  2. Create a free Pinecode account and add the API key to your .env

Building the index from Stripe docs

python build.py

The build.py script will iterate through all of the Stripe docs using the StripeDocsLoader. Once it iterates through them, it will create embeddings with Open AI's ada model and upload them to Pinecone.

This process can take 3-4 hours so you'll have to be patient!

One thing to note, sometimes the Stripe sitemap 404s. If that happens, just run the script again. I'll fix this upstream in the future.

Querying the index

python query.py

Once build.py has completed, you can run query.py to interact with it. You'll also be able to explore your index in the Pinecone interface.

About

A demo implementation of the StripeDocsReader LlamaIndex loader


Languages

Language:Python 100.0%