Integrate CodeMate chatbot into the online compiler #5
+481
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: CodeMate AI Chatbot for Online Compiler
Summary:
This PR adds CodeMate, an AI-powered chatbot integrated directly into the online compiler. It helps users understand code logic, debug errors, and optimize solutions with a strict 3-approach structure (Brute Force → Better Approach → Optimal Approach).
Key Features:
Multi-language support: JavaScript, Python, C++, Java (user-selectable).
Strict 3-approach responses: Always provides Brute Force, Better, and Optimal solutions with time & space complexity.
Full-screen responsive UI: Floating chat button 💬, expandable to fullscreen 🗖.
Markdown & syntax highlighting: Uses react-markdown and react-syntax-highlighter for clean code rendering.
Real-time AI assistance: Powered by Groq API for fast and accurate code explanations.
Environment configuration: API key stored in .env as VITE_GROQ_API_KEY.
How to Use:
Add your Groq API key to .env file:
VITE_GROQ_API_KEY=your_api_key_here
Start the development server:
npm install
npm run dev
Click the 💬 chat button to open CodeMate, select your language, and ask coding questions.
Benefits:
Helps beginners understand programming concepts easily.
Assists in choosing the most efficient solution approach.
Seamlessly integrates into the existing compiler interface.