Skip to content

Sujaz/gen_ai_terminal_chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gemini Terminal Chat

Overview

This project is a simple terminal-based chat application that interacts with Google's Gemini generative AI model using the google-generativeai Python package. Users can have a conversation with the Gemini model directly from the command line.

Installation

  1. Clone the repository:

    git clone https://github.com/Sujaz/gen_ai_terminal_chat.git
    cd gen_ai_terminal_chat/my-python-project
    
  2. Install the required dependencies:

    pip install google-generativeai
    

Usage

Option 1: Run Locally

  1. Set your Google Generative AI API key as an environment variable

    • On Windows Command Prompt:
      set API_KEY=your_api_key_here
      
    • On Windows PowerShell:
      $env:API_KEY="your_api_key_here"
      
    • On Git Bash or Linux/macOS terminal:
      export API_KEY=your_api_key_here
      
  2. Run the chat application:

    python app.py
    

Option 2: Run with Docker

  1. Build the Docker image:

    docker build -t genai-app .
    
  2. Run the chat application using Docker:

    docker run -ti -e API_KEY=your_api_key_here genai-app
    
  3. Start chatting!
    Type your messages and press Enter. Type exit to end the chat.

Example

Chat started with model: gemini-2.5-flash  Type 'exit' to end the chat.
You: Hello!
Gemini: Hello! How can I assist you today?
You: exit
Ending chat.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published