The Art of Building Intelligent Applications with Langchain and Streamlit
This is a Streamlit app that allows users to chat with a PDF document using a conversational AI model. The app uses Cohere for language modeling and question answering, and Chroma for document indexing and Langchain for chaining all these together.
Use This Colab Notebook: Click here by @log-xp and @Nikhil-Paleti
For PDF Chatbot
https://chatwithpdf.streamlit.app/
https://huggingface.co/spaces/eswardivi/ChatwithPdf/
For Widgets (Streamlit Demo)
https://widgets.streamlit.app/
To use the app, follow these steps:
- Upload a PDF document using the sidebar.
- Type your message in the "You:" field and press "Send".
- The AI model will generate a response based on the contents of the PDF document.
- The response will be displayed in the chat window.
You can adjust the temperature of the AI model and the chunk size for splitting the document using the sliders in the sidebar.
Clone the project
git clone https://github.com/EswarDivi/Anokha_Demo
Go to the project directory
cd Anokha_Demo
To use this app, you will need to create an account with Cohere and get an API key. Once you have an API key, create a file secrets.toml
in the root directory of this project and add the following line:
cohere_apikey="<your_api_key>"
Install dependencies
pip install -r requirements.txt
To deploy this project run
streamlit run Talkwithpdf.py
To deploy this project on Streamlit Sharing, follow the steps below:
-
Create an account on Streamlit Sharing and connect it to your GitHub account.
-
Fork this repository to your GitHub account.
-
In the app secrets of your Streamlit Sharing dashboard, add a new secret named
cohere_apikey
and set it to your Cohere API key. -
Click on Deploy and wait for the deployment to finish.
-
Once the deployment is finished, you can access your app on the provided URL.
Note: Make sure your Cohere API key is kept secret and is not exposed to the public.
This app was created using the following libraries: