This repository contains a simple chatbot designed to provide rehabilitation advice for football-related injuries using Google's Gemini API. The chatbot is built using Python and Streamlit, leveraging prompt engineering to tailor responses for football players seeking recovery and injury management guidance.
- Provides advice for football-related injuries such as recovery plans, exercises, and injury management.
- Lightweight, interactive user interface built with Streamlit.
- Utilizes prompt engineering to focus responses on football injury rehabilitation.
- No history is stored to maintain a clean, stateless interaction for each question.
- Python 3.8 or higher
- Virtual environment tools (e.g.,
venv
,conda
) - Internet access to interact with the Gemini API
streamlit
for the user interfacegoogle.generativeai
for the Gemini API integrationpython-dotenv
for securely managing the API key
-
Clone the Repository:
git clone https://github.com/38832/Gemini-Bot.git cd Gemini-Bot
-
Set Up a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Configure the API Key:
- Create a
.env
file in the root of the project. - Add the following line to the
.env
file, replacing<YOUR_API_KEY>
with your Gemini API key:GOOGLE_API_KEY=<YOUR_API_KEY>
- Create a
-
Start the Streamlit Server:
streamlit run app.py
-
Access the Application:
- Open your browser and navigate to the URL provided by Streamlit (usually
http://localhost:8501
).
- Open your browser and navigate to the URL provided by Streamlit (usually
-
Ask Questions:
- Enter football injury-related questions, such as:
- "What are the best recovery exercises for an ACL tear?"
- "How do I manage a sprained ankle after football practice?"
- "What stretches can I do for hamstring injuries?"
- Enter football injury-related questions, such as:
Gemini-Bot/
├── app.py # Main application file
├── requirements.txt # Required Python libraries
├── .env.example # Example file for API key configuration
├── README.md # Project documentation
└── venv/ # Virtual environment (not included in the repo)
The chatbot uses prompt engineering to tailor responses. You can modify the prompt in the get_gemini_response
function within app.py
to customize the chatbot’s behavior. For example:
football_prompt = (
"You are a highly specialized rehabilitation assistant for football players. "
"Provide detailed advice for recovery, rehabilitation exercises, and injury management. "
"Question: " + question
)
- The chatbot does not store session history.
- It depends on the Gemini API for all responses, so it requires an active API key and internet connection.
- Responses are generated based on the model’s training and may not always be medically accurate. Always consult a professional for serious injuries.
- Add session storage for user interactions.
- Enable integration with external resources or databases for enhanced knowledge.
- Fine-tune a custom model using specialized rehabilitation datasets.
This project is licensed under the MIT License. See the LICENSE file for details.
- Google Gemini API
- Streamlit Documentation
- OpenAI for inspiring the use of large language models.