- Streamlit Authentication with Streamlit Authenticator:
Streamlit Authenticator offers a straightforward approach to user authentication within Streamlit applications. In this implementation, a custom database is created within the application to manage user credentials. Users can sign up for an account or log in with existing credentials. This approach provides a hands-on understanding of user interface (UI) design in Streamlit while handling user authentication and authorization.
- FastAPI Authentication with JWT (JSON Web Tokens):
- The main method is by Fast API where endpoints are defined. Upon successful authentication, a JWT token is generated and provided to the client, valid for a specified duration (here for 15 minutes). Subsequent requests to protected endpoints require including this token in the request headers. If the token expires, i have added models.py and database.py to implement the Postgres database with Fast API
- I have uploaded with dummy database to secure my Postgres credentials.
This project is a Streamlit-based chatbot that leverages the LlamaIndex library to provide a conversational interface for querying and interacting with documents indexed from Google Drive. It uses OpenAI's GPT-3.5-turbo model to generate responses and Streamlit for the web interface.
https://drive.google.com/drive/folders/14C93jsJmExUUByg6_X07J8BQ2w9-Np68?usp=sharing
Prerequisites Before running this project, some prerequisites need to be installed:
Python 3.6 or higher (i have used python==3.10.0) A virtual environment (recommended) Create a virtual environment:
python -m venv venv Activate the virtual environment:
On Windows: .\venv\Scripts\activate
-
Clone this repository to your local machine
-
Install the required dependencies using pip: pip install -r requirements.txt
-
Set up your environment variables by creating a
.env
file in the root directory of the project. Add your OpenAI API key to the.env
file: -
Create .streamlit folder and create secrets.toml and add open ai api key [openai_key=”sk-..”]
To launch the Streamlit application, run the following command in your terminal: streamlit run main.py