OpenAI RAG Chatbot | Chat with PDF locally
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- 🌐 Ready to elevate your chatbot game? Join us on a coding adventure as we show you how to build a Responsive and Adaptive Chatbot using the power of Python, Streamlit, Langchain, an open-source vector store database, and the incredible OpenAI API!
🚀 In this hands-on tutorial, we'll guide you through the process of creating a chatbot that not only understands natural language but adapts its responses based on the context of the conversation. Python will be our language of choice, while Streamlit will provide a sleek and interactive web interface for our chatbot.
🔍 Discover the capabilities of Langchain, a dynamic natural language processing library designed to make your chatbot smarter and more context-aware. Learn how to implement an open-source vector store database, ensuring efficient storage and retrieval of conversation data for seamless interactions.
🌈 What sets this chatbot apart is its adaptability, thanks to OpenAI. We'll integrate OpenAI's state-of-the-art models to enable the chatbot to understand and respond to user queries with a level of nuance and intelligence that will leave users impressed.
Code from the video is available in the below github link :
github.com/JYT...
Super Great Explanation,
and easy to Understandable
Thank you lot !
Thank you !!
I have two queries. It would be helpful if you can assist in that.
1. Template which you are using for prompt , in the first line you have provided f string. But however in the next lines you are not giving where you have {context}, {question}. So wouldn't that make it a string rather taking context and questions as variable? Or the model will understand that?
2. My second question is that I have tested the code. It is working for most part except Chat history. Even in the same session, it is not able to remember the previous questions. It is getting updated in the chat history though. But when u explicitly ask what is my previous question or ask like explain more on previous question, it is not taking the chat history rather giving halucinated questions or says it doesnt know previous question.
Kindly clarify on the above two questions
Hi, Thanks for sharing the queries, for the 1st query, you are right, need to fix that. But for the 2nd question, this demo I have shown only the chatbot, while in the other view I have demonstrated how to utilize the memory in llm. Let me know, if you have further queries.
th-cam.com/video/-TtE7otMHCc/w-d-xo.html
Please provide pre-requisite installation otherwise as a beginner no one can recreate.
Thanks for commenting, as for pre requisite, to have python is required and VS code or Jupyter notebook is required for coding.
Hey Joy, Can you plz help how can we use input as book cover image and find similar book search with the same code , also provide the code for the same , dataset??
Hi Neha, thanks for commenting, but this approach will definitely not work for your requirement, this implementation is for textual inputs, you would need a multi modal LLM to interpret the image input. I will try to cover that in one of my future videos.
Hi, I am getting error ModuleNotFoundError: No module named 'langchain.chat_models' please help
Try uploading langchain by pip install --upgrade langchain
Hello,
thank you so much for this video.
i have a question related of summarize questions in LLM documents.
For example in vector database with thousands documents with date property, and i want ask the model how much document i received in the last week?
I guess we don't need LLM for such a query, we can query the vector DB, and for how to do that ? You can watch my video on Vector DB.
@@joymaitra5414 , thank you for the beedback, but the questions are illimited, the user can ask direct questions like "what is the latest document i have?" or he can ask "how many documents i didn't read ?", i don't know how can convert this question to vectorDB query.
may be you can add the file properties as metadata attributes in the vectorDB and then make use of that information to answer the query.
does it work with image based pdf? and if doesn't how can i make one? please suggest
Thanks for reaching out!! It does not work for image based pdf, for that chatGPT vision is required. And have to pass the pages of the pdf as image in the prompt. I am making a video on that will share soon. Request you to stay connected!!
Sir, what type of computer do you recommend for running local GPT’s? I have PrivateGPT, but it’s painfully slow on replies.
On local system with 16GB RAM and i5 processor I find the response slow bt ok, anything less than that, I hear you, it's pathetic !
Hey good video. I am trying to recreate this, created the .env all of that is situated, however when I run ui.py using streamlit, getting error AttributeError: module 'openai' has no attribute 'error'. Can you help??
Thanks for reaching out. If you are not using azure OpenAI, there can be some errors due to libraries.
@allantauro3606 hey bro have you recreated it?
@@joymaitra5414 Thanks, Joy. But if I just have API key from normal OpenAI, how can I adjust the program to fix the module problem?
thx the video! sorry my question but im a beginner in this code. What files I see github I tried to run on Codespace with no success. Is there any other file, enviroment info I should have to try and run your RAG app? Could you pls help me regarding this as a beginner?
You need to add the openAI api key as environment variable.
Thanks for the video, does this work for multiple documents as well with good accuracy?
Yes it works with multiple documents, accuracy is quite good
THIS IS amazing...
Thank you!!
Hello I am having few queries how can I reach you out please help me
You can email me
Can you plz provide the pdf of document that you used
Not able to get that point, from where i can get the pdf for book recommendation chat bot
You can use any pdf document, with text in it, I have used a blog post, saved as pdf.
Guru Bhalo Likhechish, I hope you know who I am. Don't disclose 😜. Ami Finally toke subscribe korlam. Keep going.
Thank you !!