Newly, OpenAI released the code interpreter in ChatGPT for all paying users. However, it costs $20 monthly, which is only affordable for some users. So if you want to use the free ChatGPT Code Interpreter, this guideline will show you the path. A developer named Shroominic has created an open-source implementation of ChatGPT’s code interpreter. It authorizes you to research datasets and visualize data like ChatGPT. This article will help you to understand and learn how to use the free ChatGPT code interpreter,
How do you utilize the ChatGPT code interpreter plugin for free?
The Code Interpreter allows you to change or rectify all those mistakes. Here we discuss the free and open-source Code Interpreter API project on GitHub (visit). It uses CodeBoxes, OpenAI’s API, LangChain Agent, and multiple Python packages to act like ChatGPT’s code interpreter.
Before proceeding to the process of activating ChatGPT’S free code interpreter, you must remember that :
a. For a small dataset, it works well at no charge.
b. However, when you enter a large dataset for analysis, OpenAI’s rate limit for free users hampers the process.
c. Consider adding a payment method to your OpenAI account if you plan to use it for large amounts of data.
d. The project works fine if you can access the GPT-4 API.
Step 1: Set up Code Interpreter API
1. First, you have to install Python and Pip on your computer, for which you can follow our linked tutorial. Remember to add python.exe to PATH during installation.
2. Once you have installed Python with Pip, open Terminal and run the following commands to ensure they are set up correctly. Commands will return output with their version number.
Python– version
Pip– version
3. Now, run the command below to install the Code Interpreter API.
pip install “codeinterpreterapp[all]”
4. Next, get an API key from OpenAI’s website. Click on “Create new secret key” and copy the key.
Step 2: Analyze the data using the Code Interpreter API
1. You can use your local data to analyze data for free For this, create a folder called “Analysis” on the desktop.
2. Now, move your dataset to the “Analysis” folder. The dataset may be in CSV, XSL, or XSLX formats
3. After opening the code editor, paste the code from the below
import os
os.environ[“OPENAI_API_KEY”] = “PASTE THE OPENAI API KEY HERE”
from codeinterpreterapi import CodeInterpreterSession, File
async def main():
# Context manager for auto start/stop of the session
async with CodeInterpreterSession(model=”gpt-3.5-turbo”) as session:
# define the user request
iles = [
File.from_path(“globaltemperature.csv”),
]
# generate the response
response = await session.generate_response(
user_request, files=files
)
# output to the user
print(“AI: “, response.content)
for file in response.files:
file.show_image()
if __name__ == “__main__”:
import asyncio
asyncio.run(main())
4. Here, you need to paste the OpenAI API key first and then change “globaltemperature.csv” with your dataset name. However, depending on what you want from the data, you can change the model and user query.
5. Save it as “data.py” inside the “Analysis” folder on your desktop
6. Launch Terminal and run the file in the same way.
Cd Desktop/analysis
Python data.py
How do you activate the ChatGPT code interpreter plugin?
At the bottom left corner, you must select the Settings option to access the ChatGPT Code Interpreter plugin and then follow the steps,
Click on the beta features.
Apply the code interpreter.
What can you do with the Code Interpreter plugin? (with examples)
1. Data analysis and visualization
Since you can upload files, you can hand over a file full of raw business data (like a CSV, Excel spreadsheet, SQL database, etc.) and get an AI to give you insights. Let me show you how harmful it is.
Making a map with the help of CSV data
Creating a chart with the assistance of CSV data
Working on further data modeling
2. For coding
One of the biggest annoyances of using ChatGPT to write code was that you couldn’t trust it before this update. The big limitation is that it currently runs a Python interpreter, so it still needs to be added if you work with other languages. But enabling the plugin greatly improves ChatGPT’s ability to interpret code.
Spinning it up and testing the Python code
3. Math-oriented problems
ChatGPT could be better at math, as it only guesses the next word in a sentence. Yet, now it can generate Python code to decode the problem, and it does it reasonably well.
Solve simple, text-based math.
Ask ChatGPT to solve Multiplication Math.
4. Data insights into more complex datasets
It did a decent job of understanding the data, cleaning it, thinking of relevant/appropriate visualizations, writing Python code to create that visualization, and finally, writing insights around it. It could be better, but it’s very promising compared to some of the past automated insight tools we’ve seen.
5. Image animation using ChatGPT
You can also upload a photo and let ChatGPT edit the photo. If you will upload a picture of an apple and ask it to animate. It may ask you some apparent questions, but it will ultimately write a code to animate the image as requested.