Python script to rivise error code based on the error messages using ChatGPT.
Project description
Code Fixer for Jupyter Notebook
Description
The Code Examiner and Corrector is a Python script designed to be used in Jupyter Notebook. It analyzes error code snippets and provides suggestions for correct code revisions. The script utilizes ChatGPT, an AI language model, to generate recommendations based on the given error message and context.
Features
- Analyzes error code snippets and provides suggestions for code revisions.
- Utilizes the OpenAI GPT-3.5 language model for generating code recommendations.
- Helps improve code quality and assists in debugging errors.
Requirements
- Jupyter Notebook
- Python 3.x
- OpenAI GPT-3.5 API credentials (see OpenAI documentation for details)
- Dependencies (install via pip):
- jupyter_ai_magics
- then in jupyter notebook %load_ext jupyter_ai_magics
- openai
- other dependencies as required
Usage
- Ensure you have set up the OpenAI API credentials by following the instructions in the documentation.
- Install the package with pip or clone the repo
- Open your jupyter notebook or jupyter lab file .ipynb
- Import the class AiCodeFixer from the modul code_fixer_assistent.
- When error occures, call the function AiCodeCorrector().fix_broken_code() and review the recommendations and suggestions provided by ChatGPT.
- Apply the recommended code revisions to fix errors and improve code quality.
- Repeat the process for any additional error code snippets.
Notes
- Ensure you have a stable internet connection to interact with the ChatGPT API.
- Be cautious when making changes to your code based on the suggestions provided. Verify the changes and test the code after revision.
- The effectiveness of the code suggestions and fixes depends on the quality of the error message and the complexity of the code.
- Experiment with different code snippets and variations to obtain the best results.
Acknowledgments
- The code_fixer_assistent.py script utilizes the OpenAI GPT-3.5 language model. For more information about the language model and OpenAI API, visit the official OpenAI documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jucodecorrector-0.1.0.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file jucodecorrector-0.1.0.tar.gz
.
File metadata
- Download URL: jucodecorrector-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef349b95c4b056f63faed23ce6e8942add9debfdd21a2771b81cf37974b62fbe |
|
MD5 | 4214827bf12cc972a317f67327eaf6a9 |
|
BLAKE2b-256 | 985f25870dfc98eec7990e093d93c9bdf03472a53ec04e8f253b91c87ba4bdb8 |
File details
Details for the file jucodecorrector-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: jucodecorrector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52467b013f829f4e9f6b3fc3406919e07e178fa1b361343270b5acb3a4848a5 |
|
MD5 | 1b7ed1057d4f419203140493a5d933c3 |
|
BLAKE2b-256 | 176120d378a243d0391be17256aae08d812fb273a4bcedaa3ad4df52ca0196e9 |