Skip to content

Velocity AI the sleek and responsive web-based chatbot interface powered by Google Gemini 2.0 Flash API for generating content and analyzing uploaded images.๐Ÿค– Gemini-2.0-Flash model for natural language response generation ๐Ÿ–ผ๏ธ Upload images for image input understanding ๐Ÿ“ค Pop-out buttons for file and image prompt input

Notifications You must be signed in to change notification settings

PranavHendre02/VELOCITY-AI-CHAT-BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

45 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ Velocity AI Chatbot - Gemini Powered

A modern, responsive web-based chatbot powered by the Google Gemini 2.0 Flash API for generating natural language responses and analyzing uploaded images. Built with vanilla JavaScript, this project features a clean, minimal dark-themed UI with a professional design, optimized for readability and usability across devices.

โœ… Live Demo: VELOCITY AI


โœจ Features

  • ๐Ÿค– Gemini-2.0-Flash model for intelligent text and image-based responses
  • ๐Ÿ–ผ๏ธ Image Upload for multimodal input understanding
  • ๐Ÿ’ฌ Dynamic Chat Interface with labeled user ("User") and AI ("Velocity") messages for clear distinction
  • ๐Ÿ“œ Syntax Highlighting using PrismJS for code blocks, with vertical orientation for enhanced readability
  • ๐Ÿ“ฑ Responsive Layout with media queries for seamless use on desktops, tablets, and mobile devices
  • ๐Ÿ–ค Minimal Dark Theme with glassmorphism effects in the prompt bar and header
  • ๐Ÿ”ฒ Square Chat Areas for a clean, modern aesthetic
  • ๐Ÿ“ Optimized Spacing with margin between chat container and prompt area to prevent overlap

๐Ÿ“ธ Screenshot

image alt


๐Ÿง  How It Works

The frontend is powered by vanilla JavaScript, with a straightforward workflow:

  1. User Interaction:

    • Users type messages in the text input or upload images via the file selector.
    • Inputs are captured through the <input> element and buttons.
  2. Request Handling:

    • On submission (Enter key or send button), JavaScript sends a request to:

      POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent
      
    • Payload format:

      {
        "contents": [
          {
            "parts": [
              { "text": "User message here" },
              { "inline_data": { "mime_type": "image/...", "data": "base64..." } }
            ]
          }
        ]
      }
  3. Response Rendering:

    • Gemini responses are parsed, with Markdown (e.g., code blocks, inline math) converted to HTML.
    • Code blocks are vertically oriented and syntax-highlighted using PrismJS.
    • User and AI messages are labeled with "User" and "Velocity" for clarity.
  4. Image Upload:

    • Uploaded images are converted to Base64 and included in the API request for Geminiโ€™s multimodal analysis.

๐Ÿฅ UI Design

  • ๐Ÿ–ค Dark Theme: Gradient background (#0a0a0a to #1c2526) for a sleek look
  • ๐Ÿ”ฒ Square Chat Areas: Both user and AI messages use square containers with no border-radius
  • ๐Ÿ“› Labeled Messages: User messages prefixed with "User" (blue) and AI messages with "Velocity" (yellow)
  • ๐Ÿ“œ Vertical Code/Math Display: Code blocks and math terms wrap vertically for readability, eliminating horizontal scroll
  • ๐Ÿ” Glassmorphism: Prompt bar and header use backdrop-filter: blur for a frosted-glass effect
  • ๐Ÿ“ฑ Responsive Design: Media queries ensure usability on small screens, with inline prompt buttons and scaled fonts

๐Ÿ’  Tech Stack

  • HTML / CSS / JavaScript: Core frontend technologies
  • Google Gemini 2.0 Flash API: Powers text and image-based responses
  • Font Awesome: Icons for prompt buttons
  • PrismJS: Syntax highlighting for code blocks
  • CSS Flexbox: Layout management for chat and prompt areas
  • Media Queries: Responsive design for all screen sizes

๐Ÿš€ Setup

  1. Clone the Repository:

    git clone https://github.com/PranavHendre02/VELOCITY-AI-CHAT-BOT.git
  2. Open index.html in a Browser:

    • No server is required; the app runs locally.
  3. Set Your API Key: In script.js, replace the placeholder with your Google Generative Language API key:

    const API_URL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=YOUR_API_KEY";

๐Ÿ“‚ Project Structure

chatbot-gemini/
โ”œโ”€โ”€ index.html          # Main HTML structure
โ”œโ”€โ”€ style.css           # Styling for UI and responsiveness
โ”œโ”€โ”€ script.js           # JavaScript logic for API calls and rendering
โ”œโ”€โ”€ README.md           # Project documentation

๐Ÿ“Œ Notes

  • This project does not require any backend.
  • Requires a valid API key from Google Generative Language API.
  • Use responsibly within rate limits and TOS.

๐Ÿ“„ License

MIT License


๐Ÿค›๐Ÿผ Author

Pranav Hendre


About

Velocity AI the sleek and responsive web-based chatbot interface powered by Google Gemini 2.0 Flash API for generating content and analyzing uploaded images.๐Ÿค– Gemini-2.0-Flash model for natural language response generation ๐Ÿ–ผ๏ธ Upload images for image input understanding ๐Ÿ“ค Pop-out buttons for file and image prompt input

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published