Hi there!
Hope you're having a great day! You can try out the app below.
Chat with a PDF file
Have a look at the documentation for more information on setting up the app.
- This demo application uses OpenAI, LangChain.js, Supabase and Cloudflare R2 to allow you to chat with a PDF.
- PDF is uploaded into Cloudflare R2, then split into chunks and embedded in Supabase vector storage.
- The main frontend logic is found in the
app/chat/pdf
folder. - The main configuration file can be found in
app/pdf/toolConfig.ts
file. You can specify the GPT model used & number messages included in the history. - The API endpoint and logic can be found in
app/api/pdf/chat/route.ts
. - The API to generate embeddings be found in
app/api/pdf/vectorize/route.ts
. - The API to upload PDF can be found in
app/api/pdf/upload/route.ts
. - The API to delete PDF & embeddings can be found in
app/api/pdf/delete/route.ts
. - Hope you like it - give it a try!
Login required
Please log in first to test out the demo app.
2024 — built with 🤍 by Fekri