- Notifications
You must be signed in to change notification settings - Fork0
💻 AI_CodeSolver is an intelligent assistant for developers, students, and coding enthusiasts, helping with learning, solving algorithmic problems, and debugging code.
License
andredisa/AI-CodeSolver
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Welcome toAI_CodeSolver! 🚀 This is a powerful Python project that leverages state-of-the-art AI models to help you solve coding problems automatically! Whether you're a beginner or an expert, this tool will assist you in generating optimal solutions and executing them in a safe sandbox environment.
🔧AI_CodeSolver uses OpenAI's GPT-3, Google's Gemini, and E2B sandbox environments to analyze coding problems, generate solutions, and run them in real-time.
- 📸 Image Processing: Upload an image of a coding problem, and the system will extract the problem description using advanced image recognition (powered by Gemini).
- 📝 Text Input: You can also directly type your coding problem.
- 💻 Code Generation: The AI will generate a clean, efficient, and documented Python solution for your coding problem.
- 🚀 Code Execution: Execute the generated solution in a secure sandbox environment, and get real-time results.
- 🔒 Safe Environment: Run potentially unsafe or untrusted Python code without worrying about security issues using the E2B sandbox.
- ⚡ Optimized for LeetCode-like Problems: Designed to handle typical coding challenges with proper time and space complexity.
- Python 3.x installed on your machine.
- API keys for OpenAI, Gemini, and E2B (sandbox execution).
Clone the Repository:
git clone https://github.com/andredisa/AI_CodeSolver.gitcd AI_CodeSolverCreate a Virtual Environment (optional but recommended):
python3 -m venv venvsource venv/bin/activate# On Windows: venv\Scripts\activate
Install Dependencies:
pip install -r requirements.txt
Set Up API Keys 🔑:
- Create a
.envfile in the project root directory (same level as this README). - Add your API keys in this format:
OPENAI_API_KEY=your-openai-api-keyGEMINI_API_KEY=your-gemini-api-keyE2B_API_KEY=your-e2b-api-key
Make sure you never push your
.envfile to GitHub for security reasons! 🔐- Create a
Run the Application:
Start the app with Streamlit:
streamlit run app/ui.py
Your application will open in your browser! 🌐
Input Coding Problem:
- You canupload an image of a coding problem or directlytype the problem in the text box.
Generate & Execute:
- Once you’ve entered the problem, hit the"Generate & Execute Solution" button to let the AI generate a solution and run the code.
Review the Results:
- The AI will return the solution with a breakdown of the code.
- The generated code will be executed in the E2B sandbox, and you’ll get the results right on the platform.
Check Files (if any):
- If the execution creates any files, they’ll be listed below the execution results for you to download.
- Sidebar Configuration: On the left side, configure yourAPI keys for OpenAI, Gemini, and E2B.
- Main Area:
- Input your coding problem as text or upload an image.
- Get the AI-generated solution along with the execution results.
- Real-time Feedback: See step-by-step execution logs and any generated files right after the code runs.
- Streamlit: The frontend framework to build the web interface.
- OpenAI GPT-3: Used for generating Python solutions.
- Google Gemini: For analyzing and extracting coding problems from images.
- E2B Sandbox: A secure environment to run Python code without any security concerns.
Here’s an overview of the project structure:
AI_CodeSolver/│├── app/# Main application code│ ├── init.py│ ├── ui.py# UI code (Streamlit app)│ ├── agents.py# Agents for AI interactions (OpenAI, Gemini)│ ├── sandbox.py# Sandbox management│ └── image_processing.py# Image processing (Gemini API)│├── .env# Your sensitive API keys (don't upload this to GitHub)├── .env.example# Example .env file├── .gitignore# Ignore sensitive files (e.g., .env)└── requirements.txt# List of Python dependencies
We welcome contributions! 🚀 If you have ideas for improvements, bug fixes, or new features, feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature-name). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-name). - Open a Pull Request.
This project is licensed under the MIT License - see theLICENSE file for details.
If you find my work useful and would like to support me, you can buy me a coffee! Your support helps me keep creating and improving my projects. Thank you! 😊
About
💻 AI_CodeSolver is an intelligent assistant for developers, students, and coding enthusiasts, helping with learning, solving algorithmic problems, and debugging code.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
