title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned |
---|---|---|---|---|---|---|---|
Rushis QA Chatbot |
📊 |
gray |
green |
streamlit |
1.36.0 |
app.py |
false |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Langchain Q&A Demo is a web application that leverages Langchain and OpenAI's GPT-3.5-turbo model to provide interactive question-and-answer capabilities. Built using Streamlit, this app allows users to input questions and receive responses generated by the powerful OpenAI language model.
- Interactive Q&A: Users can input questions and get responses generated by OpenAI's GPT-3.5-turbo model.
- Streamlit Integration: Simple and user-friendly web interface for seamless interaction.
- Environment Variable Management: Securely manage API keys using the
python-dotenv
package.
- Python 3.6 or higher
- pip (Python package installer)
- OpenAI API key
-
Clone the Repository:
git clone https://github.com/yourusername/langchain-qa-demo.git cd langchain-qa-demo
-
Create a Virtual Environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies: The application automatically installs required packages if they are not already installed:
python main.py
-
Set Up Environment Variables: Create a
.env
file in the project root directory and add your OpenAI API key:OPEN_API_KEY=your_openai_api_key
-
Run the Application:
streamlit run main.py
-
Interact with the Application:
- Open your web browser and navigate to
http://localhost:8501
. - Input your question in the provided text box and click "Ask the question".
- The response generated by the OpenAI model will be displayed on the page.
- Open your web browser and navigate to
This function installs the required packages if they are not already installed:
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])