Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Gemini AI - Chat App

Status License Python GUI: Tkinter Google Gemini

This is a Python application that utilizes Google Gemini AI's capabilities to provide an interactive chatbot experience. The app has a graphical user interface (GUI) built with Tkinter, and it uses Google Gemini models to generate responses based on user input.

Features

  • Chat Interface: A simple and user-friendly chat interface that allows users to interact with the chatbot.
  • Model Selection: Users can select between two models provided by Google Gemini AI: gemini-2.0-flash (free, fast) and gemini-2.5-pro (latest, most capable).
  • End Scroll Button: A "Go to End" button allows the user to quickly scroll to the latest messages in the chat.
  • API Key Management: Securely manage Google Gemini AI API keys using local encryption.
  • Supports Code Formatting: The chatbot supports rendering responses with syntax-highlighted code blocks.

Prerequisites

To run the chatbot, you'll need:

  • Python 3.8 or newer installed on your system.
  • Google Gemini AI API Key. Make sure you have a valid API key to use with the application.

Installation Guide

1. Install Python

If you do not have Python installed, you can download and install the latest version of Python 3 from Python.org. Make sure to add Python to your system PATH during the installation.

2. Clone or Create Python File

Create a directory for your project and create a Python file, for example, chatbot.py. You can use the code from the provided script to set up the chatbot.

3. Set Up Virtual Environment (Optional but Recommended)

Create a virtual environment to keep the dependencies organized:

python -m venv venv

Activate the virtual environment:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

4. Install Required Dependencies

Create a requirements.txt file with the following content:

tkinterweb
cryptography
markdown
google-generativeai
pygments

Install the dependencies by running:

pip install -r requirements.txt

5. Set Environment Variables

The application requires a master key for encryption purposes, which is set through an environment variable. Set this variable by running the following command:

export MASTER_KEY=<YOUR-SECRET-KEYS>

or on Windows

set MASTER_KEY=<YOUR-SECRET-KEYS>

6. Running the Application

After setting up the environment, run the chatbot using the following command:

python chatbot.py
or 
python3 chatbot.py

7. Packaging as an Executable File

To package the Python application into an executable file (.exe), you can use PyInstaller. Follow these steps:

Install PyInstaller:

pip install pyinstaller

Create the Executable: Run the following command to create an executable version of your script:

pyinstaller --onefile chatbot.py
  • The --onefile option ensures that all dependencies are packed into a single .exe file.

  • After running this command, a dist directory will be created containing the chatbot.exe file.

Running the Executable: Navigate to the dist directory and run the generated chatbot.exe file Note: On the first run, some antivirus software may flag the executable. You may need to mark it as safe.

About

Elegant, completely free AI chatbot powered by Google Gemini 1.5 Pro/Flash. No API keys needed.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages