This is a chatbot application that uses Google's Gemini AI for generating responses and integrates translation features using the deep_translator
library. The chatbot can translate responses into Sinhala or Tamil and also provides text-to-speech capabilities.
- Chat with Google's Gemini AI.
- Translate AI responses to Sinhala or Tamil.
- Text-to-speech functionality for translated responses.
- Streamlit-based user interface for interactive chat experience.
-
Clone the repository:
https://github.com/NishDananjaya/Gemini_chatbot_sinhala.git cd gemini-ai-chatbot
-
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your Google API key by replacing the placeholder in the script or entering it through the Streamlit sidebar during runtime.
-
Run the Streamlit app:
streamlit run app.py
-
Open the local Streamlit server link (usually
http://localhost:8501
) in your web browser. -
Interact with the chatbot, choose the translation language (Sinhala or Tamil) from the sidebar, and use the "Read" button to listen to the responses.
app.py
: Main application script containing the chatbot logic and Streamlit interface.requirements.txt
: List of required Python packages.
streamlit
: For creating the web interface.google-generativeai
: For accessing the Gemini AI model.deep_translator
: For translating text.gtts
: For converting text to speech.uuid
: For generating unique identifiers for chat messages.
- Google API Key: You need to configure the Google API key for the Gemini AI model. You can either set it directly in the script or input it through the Streamlit sidebar.
- NishDananjaya
- GitHub Profile