Skip to content

An AI-powered debugging assistant for Python students that provides Socratic hints instead of direct solutions.

Notifications You must be signed in to change notification settings

DevVyawahare/python-ai-tutor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python AI Debugging Assistant

This is an AI-powered debugging assistant I built for Python students as part of the FOSSEE Screening Task. The main idea is to help a student fix their own code by guiding them with hints, not just giving them the answer. It's a live version that connects to Google's Gemini to give real-time feedback.


Getting Started

What you'll need

Setup Instructions

  1. Save all the files (main.py, ai_debugger.py, prompt.md, README.md) in the same folder.
  2. Create a file named .env in that folder to keep your API key safe. Add your key to it like this:
    GEMINI_API_KEY="YOUR_API_KEY_HERE"
    
  3. Open your terminal and cd into the project folder.
  4. Install the required libraries:
    pip install google-generativeai python-dotenv
  5. Run the app:
    python main.py
  6. Just follow the prompts to paste your code, pick your skill level, and get feedback from the AI.

Prompt Design Choices

Here’s a breakdown of the thinking behind the prompt.md file, which tells the AI how to act.

What's the AI's personality?

I wanted the AI to feel like a friendly, patient, and encouraging tutor. It uses the Socratic method (guiding with questions) because that's a great way to build confidence and encourage critical thinking. Instead of just getting a fix, the student learns how to find the fix themselves.

How does it balance finding bugs and helping the student?

The strategy is "Hint, Don't Tell." The AI figures out the bug on its own but doesn't just give away the answer. Instead, it uses that knowledge to ask a smart question or give a targeted hint that gets the student looking in the right area. The goal is to let the student have that "aha!" moment of discovery.

How does it adapt to different skill levels?

The prompt uses a [LEARNER_LEVEL: Beginner/Advanced] tag so the AI can adjust its hints.

  • For Beginners: Hints are very specific, often pointing to a certain line or variable. The focus is on the fundamentals of syntax and how the code is running step-by-step.
  • For Advanced Learners: Hints are more high-level. They'll ask about the overall algorithm, edge cases, efficiency (like Big O notation), and other design choices to get them thinking like an experienced developer.

About

An AI-powered debugging assistant for Python students that provides Socratic hints instead of direct solutions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages