Skip to content

ahmadbanijamali/Chat-With-Me

Repository files navigation

"Chat With Me" Chrome Extension

Overview

The "Chat With Me" Chrome Extension is a simple browser extension that allows users to interact with a chatbot powered by OpenAI's API, using LLM. Users can send messages, receive responses, start new chat sessions, and manage chat history.

Functional Requirements

  1. User Interface: A popup HTML page (popup.html) that includes:

    • A container to display chat sessions.
    • A container to display the chat conversation.
    • An input field for user messages.
    • Buttons for sending messages, starting new chats, and clearing chat history.
  2. Chat Interaction:

    • User is asked to add the OpenAI API key the first time that the extension is run.
    • Users should be able to type messages and view bot responses within the chat container.
    • The chat interface should differentiate between user messages and bot responses with distinct styles.
  3. Session Management:

    • The extension should save chat sessions persistently using Chrome's storage API.
    • Users should be able to view a list of saved chat sessions and select one to view its content.
    • Users should have the option to start a new chat session, which saves the current session and clears the chat container.
    • Users should have the option to clear all chat history after a confirmation prompt.
  4. OpenAI API Integration:

    • The extension must be able to send user messages to the OpenAI API and display the bot's responses.
    • The extension should handle API authentication by storing and retrieving the OpenAI API key using Chrome's storage API.
  5. Error Handling:

    • The extension should display an error message if communication with the OpenAI API fails.
    • The extension should prompt the user to enter their OpenAI API key if it's not already stored.

Technical Requirements

  1. HTML/CSS/JavaScript: The extension must be implemented using standard web technologies: HTML, CSS, and JavaScript.

  2. Chrome Extension API: The extension must use the Chrome Extension API to interact with browser features, such as storage and scripting.

  3. OpenAI API: The extension must integrate with the OpenAI API, requiring the host_permissions to be set for https://api.openai.com/*.

  4. Styling: The extension should use a styles.css file to define the look and feel of the chat interface, ensuring a user-friendly experience.

  5. Manifest File: The extension must include a manifest.json file with the necessary metadata, permissions, and settings for a Chrome Extension.

Security Requirements

  1. API Key Storage: The OpenAI API key should be stored securely using Chrome's storage.sync API.

  2. Input Validation: User input should be properly sanitized before being sent to the OpenAI API to prevent injection attacks.

Testing Requirements

  1. Functional Testing: Verify that all user interactions work as expected, including message sending, session management, and error handling.

  2. Performance Testing: Ensure that the extension performs well, with no significant delays in message sending or session loading.

  3. Security Testing: Test for potential security vulnerabilities, particularly in the storage and handling of the OpenAI API key.

Deployment Requirements

  1. Packaging: The extension should be packaged as a ZIP file containing all necessary files for distribution.

  2. Installation Instructions: Provide clear instructions for installing the extension in Chrome, including how to load an unpacked extension for development and testing.

  3. User Documentation: Include a user guide explaining how to use the extension, manage chat sessions, and configure the OpenAI API key.

Support and Maintenance

  1. Issue Tracking: Implement a system for users to report bugs or suggest enhancements.

  2. Updates: Plan for periodic updates to the extension to address user feedback, add new features, and maintain compatibility with Chrome and the OpenAI API.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published