Skip to content

GoluKumar-Upadhyay/Python_code-debugger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Gemini-Powered Python Debugging Assistant

Flask LangChain Google Gemini Python License


📌 Overview

This project is an AI-powered debugging assistant built with Flask, LangChain, and Google Gemini.
It helps students debug Python code by giving structured hints, analysis, and debugging stepswithout revealing the direct solution.

👉 Perfect for learning by doing rather than just copy-pasting fixes.


✨ Features

  • 🐞 Buggy Code Analysis – Paste your Python code and get structured feedback.
  • 🎯 Student Level Adaptation – Explanations adjust based on beginner, intermediate, or advanced.
  • 📑 Formatted Markdown Output – Clear sections: Summary, Root Causes, Hints, Debugging Steps, Questions.
  • Gemini LLM Integration – Uses Google Gemini 2.5 Flash via google-genai.
  • 🌐 Web Interface – Simple Flask frontend with HTML/CSS for input and results.
  • 🧠 LangChain PromptTemplate – Ensures consistent, structured responses.

🛠️ Tech Stack


Proejct working image

Screenshot_7-9-2025_15716_127 0 0 1

🐍 Python Debugger Web App

This project is a Flask-based Python Debugger that allows users to paste buggy Python code, select their experience level, and receive personalized debugging suggestions powered by the Gemini API.


📌 Features

  • ✍️ Code Input Box – Paste your buggy Python code.
  • 🎚️ Skill Level Selection – Choose:
    • Beginner → Detailed step-by-step explanations.
    • Intermediate → Balanced hints + best practices.
    • Advanced → Concise debugging + optimization tips.
  • Gemini API Integration – Analyzes the code and returns smart debugging feedback.
  • 🎨 Dark-Themed UI – Developer-friendly interface with clear sections.

🖼️ Frontend: index.html

The index.html file acts as the main input page for the debugger.

🔹 Structure Overview

  1. Header Section

    • Title: Python Code Debugger
    • Subtitle: Explains purpose (static analysis + debugging suggestions).
  2. Code Input Area

    • Large text editor for pasting buggy Python code.
    • Preloaded example (e.g., Fibonacci function) for guidance.
  3. Skill Level Selection

    • Options: Beginner | Intermediate | Advanced.
    • Ensures feedback is tailored to the user’s coding level.
  4. Action Button

    • “Analyze & Debug Code” (green button).
    • On click → sends code + level choice to the Flask backend.

⚙️ Backend Flow

  1. User enters buggy code + selects level → index.html form submission.
  2. Flask (app.py) captures inputs.
  3. Code + level are sent to Gemini API.
  4. API response (debugging hints) is displayed in result.html.

📂 File Roles

  • index.html → Input page (buggy code + skill level).
  • result.html → Output page (Gemini API debugging feedback).
  • app.py → Flask backend (handles requests + API calls).

Screenshot_7-9-2025_2020_127 0 0 1

  • result.html → Display Gemini’s debugging feedback.

working video

📂Project Str

image

⚙️ Setup & Installation

1. Clone Repo

git clone https://github.com/your-username/gemini-debug-assistant.git
cd gemini-debug-assistant


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published