A simple web application for converting and enhancing code using OpenAI's GPT-3.
This web application uses OpenAI's GPT-3 to provide code conversion, debugging, and code quality assessment services. You can use this application to:
- Convert code from one programming language to another.
- Debug code by checking for errors and providing corrections.
- Assess the quality of code and receive improvement suggestions.
- Code conversion between different programming languages.
- Code debugging and error correction.
- Code quality assessment with improvement suggestions.
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your local development machine.
- An OpenAI API key. You can obtain one by signing up at OpenAI.
-
Clone this repository:
git clone https://github.com/yourusername/CodeConvertor.git
-
Navigate to the project directory:
cd code_converter
-
Install the required dependencies:
npm install
-
Create a
.env
file in the root directory of the project and add your OpenAI API key:API_KEY=your_openai_api_key_here
To convert code from one programming language to another:
-
Make a POST request to
/convert
with the following JSON payload:{ "code": "your_source_code_here", "language": "target_language_here" }
-
The server will respond with the converted code.
To debug code and check for errors:
-
Make a POST request to
/debug
with the following JSON payload:{ "prompt": "your_code_to_debug_here" }
-
The server will respond with debug information, error checking, and corrections if needed.
To assess the quality of code and receive improvement suggestions:
-
Make a POST request to
/quality
with the following JSON payload:{ "prompt": "code_to_assess_quality_here" }
-
The server will respond with detailed quality assessment and improvement tips.
/convert
: Converts code from one language to another./debug
: Debugs code and provides error checking and corrections./quality
: Assesses the quality of code and offers improvement suggestions.
You can configure the application by setting the API key in the .env
file.