Skip to content

πŸš€ Automated Code Correction Framework An AI-powered debugging tool that: βœ… Captures and logs errors from executed programs βœ… Analyzes errors and provides explanations with real-world examples βœ… Automatically corrects faulty code using LLMs (Google Gemini, OpenAI, Claude, etc.). Built with Python and LangChain.

License

Notifications You must be signed in to change notification settings

Deekshith-poojary/Automated-Code-Correction

Repository files navigation

Automated Code Correction Framework

Overview

The Automated Code Correction Framework is an AI-powered debugging tool designed to automate error detection and correction. It streamlines the debugging process by analyzing errors, providing relevant solutions, and applying corrections to faulty code. Implemented in Python, the system leverages LangChain for AI-driven automation.

Features

  • Logger: Captures and stores errors from executed programs in a log file.
  • AI Agent 1: Extracts errors, explains their causes, and provides relevant examples from sources like Stack Overflow in a GUI.
  • AI Agent 2: Extracts faulty code, sends it to a Large Language Model (LLM) for correction, and replaces the erroneous lines with the fixed code.
  • Automated Debugging: Reduces manual effort and enhances development efficiency.
  • GUI: Shows the error analysis in a GUI.

Technologies Used

  • Python
  • LangChain (for AI agents)
  • Large Language Model (LLM) (for code correction)
  • Python Tkinter (for displaying error analysis and examples)

Installation

  1. Clone the repository:
    git clone https://github.com/Deekshith-poojary/Automated-Code-Correction.git
    cd Automated-Code-Correction
  2. Install dependencies:
    pip install -r requirements.txt
  3. Set up your LLM API keys in agentone.py and agenttwo.py:
    • The project uses Google Gemini AI API Key by default.
    • Users can also configure OpenAI or Claude API keys as alternatives.

Usage

  1. Simply run your error-prone program file by importing the global_logger module:
    import global_logger
    Example usage:
    import global_logger
    
    print(3/0)#it will through division by zero error.
  2. The framework will automatically capture errors, analyze them, and provide corrected solutions.
  3. View debugging insights and corrected code in the GUI.

Contribution

Feel free to contribute to the project by submitting pull requests. Ensure your code follows best practices and includes proper documentation.

License

This project is licensed under the MIT License.

Contact

For queries or contributions, reach out to deekshithpoojary122d@gmail.com.

About

πŸš€ Automated Code Correction Framework An AI-powered debugging tool that: βœ… Captures and logs errors from executed programs βœ… Analyzes errors and provides explanations with real-world examples βœ… Automatically corrects faulty code using LLMs (Google Gemini, OpenAI, Claude, etc.). Built with Python and LangChain.

Topics

Resources

License

Stars

Watchers

Forks

Languages