mahaveergurjar / Chatbot

Chat application allows users to send messages and receive responses from a language model API. It supports code formatting, explanations, and link formatting. The application uses GoogleGenerativeAI for API requests and displays chat messages in a styled interface.
MIT License
7 stars 23 forks source link
hacktoberfest hacktoberfest-accepted hacktoberfest2024
// design by Mahaveer

Desktop ChatBot Application

Overview

This chat application allows users to send messages and receive responses from a language model API. It supports code formatting, explanations, and link formatting. The application uses GoogleGenerativeAI for API requests and displays chat messages in a styled interface.

Features

Installation

To set up and run the chat application locally, follow these steps:

Prerequisites

Steps

  1. Clone the Repository

    git clone https://github.com/mahaveergurjar/Chatbot.git
    cd Chatboot
    
  2. Install Dependencies

    npm install

  3. Create API Key

    To generate an API key for Gemini AI, follow these steps:

    1. Visit the Gemini AI API Key Generation page.
    2. Sign in with your Google account if prompted.
    3. Generate a new API key.
    4. Copy the generated API key.
  4. Add Your API Key

  5. Set Up .env File

    • Rename the .env.example file to .env:

      mv .env.example .env
    • Open the .env file and add your API key:

      API_KEY=Your_Generated_API_Key
  6. Run the Application

    npm start

//credited to Tarush Gupta

Position Customization

You can adjust the app screen size and position in config.js:

Screenshot

Compact View ChatBot

//credited to Alok

UI After Theme Button Added

Light Theme UI Screenshot Dark Theme UI Screenshot

Description:The Button on the top right corner has an evenListener attached on click and switches between dark and light by changing the path of the image that is the src attribut of img tag.