Skip to content

Free ChatGPT code interpreter learn how to use

[ad_1]

introduction

OpenAI not too long ago made Code Interpreter in ChatGPT accessible to all paying customers, however the $20 for 30 days worth might not be inexpensive for everybody. Nevertheless, if you wish to use ChatGPT Code Interpreter for completely free, you might be in luck. A developer named Shroominic has created an open supply implementation of the ChatGPT code interpreter. With this implementation, you possibly can run dataset analysis and visualize the info similar to you’d with ChatGPT. On this tutorial, we are going to stroll you thru the tactic of utilizing Code Interpreter completely free.

Points to remember earlier than continuing additional

Utilizing the free and open-supply code interpreter Enterprise API

At first, we’ll in all probability be utilizing the Code Interpreter API mission, which is freely accessible on GitHub. This mission makes use of CodeBoxes, OpenAI’s API, LangChain Brokers, and quite a few Python packages to imitate ChatGPT’s code interpreter habits. It’s environment friendly for small datasets and comes free. Nevertheless, evidently for these intending to research large quantities of information, OpenAI’s price cap without spending a dime clients could stop you from doing so. If that’s the case, contemplate together with a paid methodology in your OpenAI account.

Compatibility with GPT-3.5-turbo dummy

Whereas the Code Interpreter API works superb with the GPT-4 API, this particular tutorial focuses on making it appropriate with the GPT-3.5-turbo mannequin. Subsequently, we now have now custom-made the code accordingly.

Step 1: Configure the code interpreter API

Putting in Python and Pip

To get began, you must have Python and Pip put in in your PC. If you have not entered them but, you possibly can comply with our linked tutorial for steering. Throughout the set up course of, ensure you add python.exe to your PATH.

Verifying Python and Pip configuration

After coming into Python and Pip, open Terminal and run the next directions to ensure they’re organized accurately:
– python model
– pip model

These directions ought to return their respective mannequin numbers, confirming that Python and Pip have been entered accurately.

Inclusion of the code interpreter API

Subsequent, run the subsequent command to insert the Code Interpreter API:
– pip arrange code interpreters

Acquiring an API key

After setup is full, go to the OpenAI web site and buy an API key. Click on Create new secret key and replicate the essential factor.

Step 2: Run the ChatGPT code interpreter without spending a dime

Getting ready the code editor

To run the Code Interpreter API for completely free, open a code editor like Stylish Textual content material or Notepad++ and proceed to the subsequent step.

Embody the code and make adjustments

Copy the code supplied beneath and paste it into the code editor. This code comes from the Code Interpreter API GitHub webpage, nevertheless we have now made a few adjustments to stop potential errors:

“`python
import working system
os.environ(“OPENAI_API_KEY”) = “PASTE OPENAI API KEY HERE”
from codeinterpreters import CodeInterpreterSession

async def main():
# Create a session
session = CodeInterpreterSession(model=”gpt-3.5-turbo”)
wait session.astart()

# Generate a response primarily based totally on individual enter
response = await session.generate_response(
Chart the worth of Apple stock from 2007 to 2023 June
)

# Output response (textual content content material + picture)
print(AI: , response. materials content material)

per file in response.information:
file.show_image()

# Finish the session
wait session.astop()

if __name__ == “__main__”:
import asyncio
# Carry out asynchronous execution
asyncio.run(main())
“`

Highlighted in crimson all through the code are areas that require adjustments. First, paste your OpenAI API key into the second line. After you have entry to the GPT-4 API, you possibly can define the gpt-4 mannequin within the ninth line. Within the fourteenth line, you possibly can enter your query and description what sort of graph you wish to create.

Save this file as chart.py in your desktop, ensuring it has a .py extension.

Code execution

Open the Terminal and run the next directions one after the opposite:
1. “`cd desktop“`
2. “`python chart.py“`

Give it a few seconds and the Code Interpreter API will generate the desired graph for you. This course attracts on a number of background suppliers, together with LangChain Brokers, Yahoo Finance information from the net, Matplotlib to plot the chart, and extra. To view the detailed course of the background occasion, you possibly can add the subsequent line to your code:
– “`os.environ(“VERBOSE”) = “True”“`

From this level ahead, you possibly can merely edit the query throughout the code and run the chart.py file once more to generate new charts.

Step 3: Consider info utilizing the code interpreter API

Group of the info set

If you wish to do information evaluation utilizing your particular person native information, begin by making a folder referred to as evaluation in your desktop.

Together with the dataset

Subsequent, switch your dataset to the analysis folder. The dataset may very well be in CSV, XSL or XSLX format. For instance, suppose you now have a file named globaltemperature.csv within the analysis folder.

Modification of the Code

Open the code editor and paste the subsequent code:
“`python
import working system
os.environ(“OPENAI_API_KEY”) = “PASTE OPENAI API KEY HERE”
from codeinterpreterapi import CodeInterpreterSession, File

async def main():
# Supervisor context for automated session begin/finish
async with CodeInterpreterSession(model=”gpt-3.5-turbo”) as session:
# Define the individual’s request
user_request = Analyze this dataset and plot worldwide temperature for 12 months from 1950 to 2016. Ponder the GCAG system.

information = (File.from_path(“globaltemperature.csv”),)

# Generate response
response = ready for session.generate_response(user_request, information=information)

# Ship the reply to the individual
print(AI: , response. materials content material)

per file in response.information:
file.show_image()

if __name__ == “__main__”:
import asyncio
# Carry out asynchronous execution
asyncio.run(main())
“`

Much like the code above, make sure to paste in your OpenAI API key. Additionally, swap globaltemperature.csv along with your dataset identifier. You may as well modify the model and individual query to suit your specific wants.

Save this file as information.py positioned within the analysis folder in your Desktop.

How the code works

Launch Terminal and run the next directions:
1. “`cd Desktop/analysis“`
2. “`python information.py“`

Because of this, you’ll get a graph based in your native dataset. You could possibly have effectively used the Code Interpreter API for dataset analysis with out incurring any fees.

Conclusion

On this tutorial, we explored the best way to use the completely free Code Interpreter whereas benefiting from the open-source implementation developed by Shroominic. By organizing the code interpreter API, completely free opcode and performing information analysis, you possibly can leverage the code interpreter capabilities of ChatGPT with out the financial burden of a paid subscription.

Ceaselessly Requested Questions (FAQ)

1. Can I take advantage of OpenAI’s Code Interpreter without spending a dime?

After all, you must use Code Interpreter completely free by following the indications supplied on this tutorial. The open supply implementation developed by Shroominic means that you can profit from Code Interpreter’s choices with out incurring any prices.

2. What’s the worth of the OpenAI code interpreter?

OpenAI’s code interpreter is accessible to paying clients at a worth of $20 for 30 days. Nevertheless, this tutorial guides you on the best way to use it for completely free by profiting from the open supply implementation.

3. What are the wants to make use of completely free Code Interpreter?

To make use of Code Interpreter completely free, you must have Python and Pip put in in your pc. Additionally, you will want an OpenAI API key, which may very well be obtained from the OpenAI web site.

4. Can I leverage my dataset for information evaluation with Code Interpreter?

After all, you must use your particular person dataset for information evaluation with Code Interpreter. The tutorial affords detailed steering on the best way to arrange the evaluation utilizing your native information in CSV, XSL or XSLX format.

5. What modes are supported by the Code Interpreter API?

The Code Interpreter API helps varied fashions, together with GPT-3.5-turbo and presumably GPT-4. You may modify the code supplied within the tutorial to profit from totally different templates in response to your wants.

[ad_2]

To entry further info, kindly seek advice from the next link