Skip to content

Mitenlnmiit/Reply_Assist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Refinement Assistant

A lightweight Chrome/Edge extension that integrates with any web-based chat system (WhatsApp Web, LinkedIn, Gmail, Reddit, etc.). The extension refines draft replies using Google Gemini API by analyzing the previous messages in the conversation thread and returning a polished, context-aware response.

Features

  • Context-Aware Refinement: Analyzes conversation history to provide relevant, context-aware suggestions
  • Universal Compatibility: Works on all major chat platforms (WhatsApp Web, Gmail, LinkedIn, Reddit, etc.)
  • Privacy-Focused: No data stored locally or on servers - uses your own Gemini API key
  • Keyboard Shortcuts: Quick access with ALT+X (preview) and ALT+Q (replace)
  • Real-time Processing: Fast response times with Google's Gemini 2.5 Flash Lite model
  • Customizable System Prompt: Edit the system prompt in Options to control the assistant's behavior

Installation

Method 1: Load as Unpacked Extension (Recommended for Development)

  1. Download the Extension

    • Clone or download this repository
    • Extract the files to a folder on your computer
  2. Get a Gemini API Key

    • Visit Google AI Studio
    • Sign in with your Google account
    • Create a new API key
    • Copy the API key for later use
  3. Install in Chrome/Edge

    • Open Chrome or Edge browser
    • Go to chrome://extensions/ or edge://extensions/
    • Enable "Developer mode" (toggle in top-right corner)
    • Click "Load unpacked"
    • Select the folder containing the extension files
    • The extension should now appear in your extensions list
  4. Configure the Extension

    • Click on the extension icon in your browser toolbar
    • Click "Configure API Key"
    • Enter your Gemini API key
    • Click "Save Settings"
    • Test the connection to ensure it's working

Method 2: Manual Installation

  1. Follow steps 1-2 from Method 1
  2. Open Chrome/Edge and go to extensions page
  3. Enable Developer mode
  4. Click "Load unpacked" and select the extension folder
  5. Configure your API key as described above

Usage

Basic Usage

  1. Navigate to any chat application (WhatsApp Web, Gmail, LinkedIn, Reddit, etc.)
  2. Click in a text input field and type your message
  3. Use keyboard shortcuts:
    • ALT+X (or Cmd+Shift+P on Mac): Preview refined version
    • ALT+Q (or Cmd+Shift+L on Mac): Replace with refined version

How It Works

  1. Text Detection: The extension automatically detects when you're in a text input field
  2. Context Analysis: It extracts the conversation history from the page (last 1K-2K tokens)
  3. AI Processing: Sends your draft + context to Google Gemini API for refinement
  4. Response Handling:
    • Preview mode: Shows a popup with original vs refined text
    • Replace mode: Directly replaces your draft with the refined version

Supported Platforms

  • WhatsApp Web
  • Gmail
  • LinkedIn
  • Reddit
  • Discord
  • Slack
  • Microsoft Teams
  • And many more chat applications

Configuration

API Key Setup

  1. Click the extension icon in your browser toolbar
  2. Click "Configure API Key"
  3. Enter your Gemini API key from Google AI Studio
  4. Click "Save Settings"
  5. Test the connection to verify it's working

Keyboard Shortcuts

  • ALT+X: Preview refined reply
  • ALT+Q: Replace with refined reply

You can customize these shortcuts in your browser's extension settings.

Privacy & Security

  • No Data Storage: Your messages are only sent to Google's Gemini API
  • Your API Key: You control your own API key and usage
  • No Tracking: No analytics or user tracking
  • Local Processing: All text extraction happens in your browser
  • No Third-Party Servers: Direct communication with Google's API only

Troubleshooting

Common Issues

Extension not working:

  • Make sure you're on a supported website
  • Ensure you've clicked in a text input field
  • Check that the extension is enabled

API errors:

  • Verify your API key is correct
  • Check that you have sufficient API quota
  • Ensure you have an active internet connection

Keyboard shortcuts not working:

  • Try refreshing the page
  • Check for conflicts with other extensions
  • Verify the extension is enabled

No conversation context:

  • The extension works best on pages with clear message structures
  • Some chat applications may have different DOM structures
  • Try on different chat platforms

Getting Help

  1. Check the browser console for error messages
  2. Verify your API key is working by testing the connection
  3. Try on different websites to isolate the issue
  4. Check that all extension files are properly loaded

Development

Project Structure

chat-refinement-extension/
├── manifest.json          # Extension manifest
├── content.js            # Content script for DOM manipulation
├── background.js         # Background script for API calls
├── popup.html           # Extension popup UI
├── popup.js             # Popup script
├── options.html         # Options/settings page
├── options.js           # Options script
├── icons/               # Extension icons
│   ├── icon16.svg
│   ├── icon32.svg
│   ├── icon48.svg
│   └── icon128.svg
└── README.md            # This file

Building from Source

  1. Clone the repository
  2. No build process required - it's a pure JavaScript extension
  3. Load as unpacked extension in Chrome/Edge

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is open source and available under the MIT License.

Changelog

Version 1.0.0

  • Initial release
  • Basic chat refinement functionality
  • Support for major chat platforms
  • Google Gemini API integration
  • Keyboard shortcuts
  • Privacy-focused design

Support

For issues, questions, or contributions, please visit the project repository or create an issue.


Note: This extension requires a Google Gemini API key to function. The API key is free to obtain and use within Google's usage limits.

About

Get refined text for replies instantly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors