CodeInterpreterGPT is a project that leverages the GPT-4 model provided by OpenAI, Anaconda's PowerShell Prompt, and native Command Shell to create a system capable of interpreting and executing both Python and shell commands. This project aims to provide a highly interactive and versatile tool for Python programmers, data scientists, machine learning enthusiasts, and system administrators.
The project is structured to use OpenAI's API to interpret and execute Python code snippets in an environment that resembles a Jupyter Notebook. This environment is facilitated by the integration of Anaconda PowerShell Prompt, which provides a robust and versatile command-line interface for Python code execution. Utilizing the capabilities of the GPT-4 model, the project can conduct data analysis tasks, making it a useful tool for data exploration and comprehension. The repository also includes a CommandShellExecutor class wrapped within a CommandShellManager. This setup allows GPT-4 to execute shell commands while maintaining a stateful experience.
- Getting Started
- Core Features
- Primary Components
- Installation
- Usage
- Required Dependencies
- Known Limitations
- Future Developments
- Contribution Guidelines
- License Information
To begin with CodeInterpreterGPT, you need to have Python and Anaconda installed on your system. Once you have these prerequisites, clone the repository and install the necessary dependencies. After setting up the environment, you can run the main.py
file to start the application.
CodeInterpreterGPT uses OpenAI's API to interpret and execute Python code snippets within a Jupyter Notebook-like environment.
CodeInterpreterGPT integrates seamlessly with Anaconda PowerShell Prompt, offering a robust environment for executing Python code.
The project leverages the power of the GPT-4 model for data analysis tasks.
Newly integrated Command Shell Executor allows for executing native shell commands within the same environment, making the tool more versatile.
main.py
: The main entry point of the application, responsible for initializing theCodeExecutor
class and starting the execution.code_executor.py
: This file houses theCodeExecutor
class, which takes care of executing Python code snippets.command_shell_executor.py
: Executes shell commands.openai_api.py
: This module contains the necessary functions for interacting with the OpenAI API.interactive_shell.py
: This script creates an interactive shell for executing commands.command_shell_manager.py
: Manages the Command Shell Executor.
Follow these steps to install and set up CodeInterpreterGPT:
- Ensure that Python and Anaconda are installed on your system.
- Clone the CodeInterpreterGPT repository to your local machine.
- Navigate to the cloned repository and install the required dependencies using the
requirements.txt
file. - Run the
main.py
script to start the application.
To use CodeInterpreterGPT, follow these steps:
- Open the Anaconda PowerShell prompt and navigate to the directory containing the
main.py
file. - Run
python main.py
to launch the application. - You will be prompted to enter Python code snippets for interpretation and execution.
Note: You will need an OpenAI API key to use the application, which you can obtain from the OpenAI website.
- OpenAI API
- Anaconda PowerShell Prompt
- Python
CodeInterpreterGPT is currently in the proof-of-concept stage. It can interpret and execute simple Python code snippets effectively. However, more complex code or code requiring additional dependencies may not function as expected.
Future versions of CodeInterpreterGPT will concentrate on enhancing its code execution capabilities, potentially introducing features like streaming outputs similar to ChatGPT. Other possible improvements include code debugging, performance profiling, and code optimization.
Contributions to CodeInterpreterGPT are welcomed. Feel free to submit pull requests or open issues on the GitHub repository if you have suggestions, improvements, or fixes.
CodeInterpreterGPT is open-source software released under the MIT license. For further details, please refer to the LICENSE
file in the repository.