Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

💻 CodeMate AI — Your Personal Programming Assistant

CodeMate AI is an AI-powered programming assistant built using Python and the Groq API. It helps users learn programming, debug code, understand errors, and solve coding and Data Structures and Algorithms (DSA) problems through an interactive conversation.

With support for Python, C, C++, and Java, CodeMate AI aims to make programming easier, especially for beginners, by providing simple explanations, corrected code, and step-by-step guidance.

✨ Features

  • 🌐 Multi-Language Support: Choose Python, C, C++, or Java.
  • 🐛 Code Debugging: Identify errors and understand why they occur.
  • 🛠️ Code Correction: Get corrected code with explanations.
  • 📚 Concept Learning: Understand programming concepts in simple language.
  • 👣 Step-by-Step Explanations: Learn how code works.
  • 🧠 DSA Assistance: Get help with algorithms, data structures, and coding problems.
  • ⚡ Code Optimization: Explore more efficient solutions and time and space complexity.
  • 💬 Conversational Interaction: Ask follow-up questions while retaining conversation context.
  • 📡 Streaming Responses: Receive AI-generated responses as they are produced.
  • 🔒 Error Handling: Handle API and runtime request errors gracefully.

🛠️ Tech Stack

Technology Purpose
Python Core application logic
Groq API AI inference and chat completions
Groq Python SDK Communication with the AI service
openai/gpt-oss-120b AI model used for programming assistance
Google Colab / Jupyter Notebook Development and execution

⚙️ How It Works

  1. Choose a language: Select Python, C, C++, or Java.
  2. Enter a question: Ask about a programming concept, code error, or DSA problem.
  3. Process the request: The application sends the question and conversation history to the Groq API.
  4. Generate a response: The AI model produces a programming-focused answer.
  5. Stream the output: The response is displayed progressively in the terminal.
  6. Continue learning: Ask follow-up questions without losing the current conversation context.
  7. Exit anytime: Type exit to end the session.

🚀 Getting Started

Prerequisites

  • Python 3.9 or later
  • A Groq API key
  • Internet connectivity
  • Google Colab, Jupyter Notebook, or a local Python environment

1. Clone the Repository

git clone https://github.com/brubasree007/CodeMate-AI.git
cd CodeMate-AI

2. Install Dependencies

pip install groq

3. Configure Your API Key

Create an API key through the Groq Console.

For security, store your API key in an environment variable named GROQ_API_KEY instead of hardcoding it in your source code.

Windows PowerShell:

$env:GROQ_API_KEY="your_groq_api_key"

Linux / macOS:

export GROQ_API_KEY="your_groq_api_key"

In your Python notebook, initialize the client securely:

import os
from groq import Groq

client = Groq(
    api_key=os.environ["GROQ_API_KEY"]
)

Replace the existing hardcoded API-key initialization with this code before running the notebook.

4. Run the Notebook

Open CodeMate_AI.ipynb in Google Colab or Jupyter Notebook and execute the cells in order.

Follow the prompts to select a programming language and start chatting with CodeMate AI.

💡 Example Interaction

💻 CodeMate AI
Your Personal Programming Assistant

Select your programming language:
1. Python
2. C
3. C++
4. Java

Enter your choice (1-4): 1

Selected Language: Python
Type 'exit' to quit.

You: Explain the difference between a list and a tuple.

CodeMate: A list is mutable, meaning you can modify its elements.
A tuple is immutable, meaning its elements cannot be changed
after creation.

The conversation above is illustrative. Actual responses are generated by the AI model.

📂 Project Structure

CodeMate-AI/
├── CodeMate_AI.ipynb
└── README.md

🎯 Project Objective

The objective of CodeMate AI is to make programming more accessible by combining artificial intelligence with interactive learning. It provides a convenient way for users to understand code, troubleshoot errors, practice problem-solving, and improve their programming skills.

🔮 Future Enhancements

  • Develop a web-based interface for a better user experience.
  • Integrate code execution and automated test-case evaluation.
  • Add support for more programming languages.
  • Introduce dedicated DSA practice and learning modes.
  • Provide detailed complexity analysis and code optimization suggestions.
  • Add user authentication and persistent chat history.
  • Support code file uploads and project-level analysis.

🔐 Security

  • Never expose API keys in public repositories.
  • Use environment variables or secure secrets management.
  • Rotate any API key that has been exposed.
  • Avoid committing credentials to Git history.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages