This Python application utilizes the Gemini Pro API from google.generativeai
to create an interactive chat interface. It allows users to have a conversation with the Gemini Pro AI model, with features like viewing chat history, restarting chats, and automatically saving chat sessions to a text file with timestamps.
- Python 3.x
- Pip package manager
- An API key for Gemini Pro
-
Clone the repository:
git clone https://github.com/llegomark/gemini-pro-chat.git cd gemini-pro-chat
-
Install required Python packages:
pip install -r requirements.txt
-
Create a
.env
file in the project directory and add your Gemini Pro API key:GEMINI_API_KEY=your_api_key_here
Run the application using Python:
python chat.py
- Type your message and press Enter to chat with Gemini Pro.
- Type
history
to view the complete chat history. - Type
restart
to start a new chat session while saving the current session tochat_history.txt
. - Type
exit
to exit the application and save the current session.
- Interactive chat with Gemini Pro AI.
- View chat history within the application.
- Automatically saves chat sessions with timestamps.
- Supports restarting chat sessions while preserving history.
- Streaming output for a more natural chat experience.
Contributions to the Gemini Pro Chat Application are welcome. Please feel free to fork the repository, make improvements, and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Google's Gemini API for providing the language model. More information about the Gemini API can be found in Google's official announcement.