DEV Community

Cover image for Chat with your PDF using Pinata,OpenAI and Streamlit

Chat with your PDF using Pinata,OpenAI and Streamlit

Jagroop Singh on October 10, 2024

In this tutorial, we’ll build a simple chat interface that allows users to upload a PDF, retrieve its content using OpenAI’s API, and display the r...
Collapse
 
john12 profile image
john

@jagroop2001 ,
Wow, I didn't know we could create such an AI project so easily! Integrating Pinata, OpenAI, and Streamlit opens up so many possibilities for building interactive applications.
I would try with image to text generation. Can you suggest is it feasible ?

Collapse
 
jagroop2001 profile image
Jagroop Singh

@john12 ,
Creating an image-to-text generation application using OpenAI's models is definitely possible! The advanced features of models like GPT-4 and DALL-E make this a realistic and exciting project.

Collapse
 
john12 profile image
john

@jagroop2001 ,Thank you so much! 🙌✨ I'm really excited about this project! 😊

Thread Thread
 
jagroop2001 profile image
Jagroop Singh

@john12 , let me know if you need any help in your project.

Thread Thread
 
john12 profile image
john

@jagroop2001 , sure thanks

Collapse
 
works profile image
Web

@jagroop2001
Whoa! Fantastic Project using OpenAI and Pinata. I've tried this and it works well.
Your API keys aren't functioning, by the way. I attempted to utilize this

Collapse
 
jagroop2001 profile image
Jagroop Singh

@works ,
yes because I have shown this for demo purpose after that I delete the @pinata keys and regenerated new ones.

Collapse
 
works profile image
Web

@jagroop2001 , got it.
Can you guide me that how I would build a platform like that where code file uploaded and OpenAI generate code review of it and also provide optimized code correction.

Is this possible with OPEN AI

Thread Thread
 
jagroop2001 profile image
Jagroop Singh

@works ,
Yes, it's possible to build a platform that allows code file uploads, with OpenAI generating code reviews and offering optimised corrections. You can achieve this by integrating OpenAI's API or Gemini API ( which is free) or Open Source Model for code analysis and Pinata for secure file storage, all within a React-based front-end.

I'm already working on this exact problem statement and plan to publish the project within a few days, using Pinata, OpenAI, React, and other technologies.

Thread Thread
 
works profile image
Web

Wow , I will be waiting for this as this would really help me to learn with your code refence. @jagroop2001

Collapse
 
martinbaun profile image
Martin Baun

I highly recommend you take a look at LangChain :)

Collapse
 
jagroop2001 profile image
Jagroop Singh

Sure @martinbaun , any resources ??

Collapse
 
jagroop2001 profile image
Jagroop Singh

@martinbaun , are you pointing to built this project using Langchain using RAG's ?

Collapse
 
dark_coder_vibes profile image
Dark Coder

there is a project called repochat that is for the same purpose. still great read!

Collapse
 
jagroop2001 profile image
Jagroop Singh

@dark_coder_vibes ,
Thank you for the heads-up! I appreciate the mention of repochat—it’s always interesting to see different approaches to similar goals. Glad you enjoyed the read!

Collapse
 
paxnw profile image
caga

Sounds interesting @jagroop2001 ,
Why Pinata when we can store that in any 3rd party bucket or even in backend public folder ?

Collapse
 
jagroop2001 profile image
Jagroop Singh

@paxnw ,
@pinata is great because it leverages IPFS, giving files a decentralized home that's secure, accessible.
Unlike a typical backend folder or cloud storage, IPFS ensures that files are immutable and distributed, reducing dependency on any single server.
This can boost performance, especially for apps that need reliable file access across multiple locations. Plus, Pinata’s API makes integration and file management a breeze!