[ad_1]
Introduction
OpenAI lately made the code interpreter in ChatGPT obtainable to all paying prospects, though the worth of $20 for 30 days will not be inexpensive for everybody. Nonetheless, if you wish to use the free ChatGPT code interpreter, you could be in luck. A developer named Shroominic has created an open supply implementation of the ChatGPT code interpreter. With this implementation, you may in all probability run dataset evaluation and visualize info just like ChatGPT. On this tutorial, we are going to present you the best way to use Code Interpreter without cost.
Issues to notice earlier than continuing
Utilizing the free and open-supplied code interpreter Enterprise API
First, we’ll in all probability use the Code Interpreter API mission, which is out there without cost on GitHub. This mission makes use of Codebox, OpenAI’s API, Langchain brokers, and a number of other Python packages to imitate ChatGPT’s code interpreter habits. It’s atmosphere pleasant for small datasets and comes freed from price. Nonetheless, apparently for individuals who need to analysis giant quantities of data, OpenAI’s free worth restrict might forestall you from doing so. In that case, take into account including a fee methodology to your OpenAI account.
Compatibility with GPT-3.5-Turbo Dummy
Whereas the Code Interpreter API works nice with the GPT-4 API, this specific tutorial focuses on making it suitable with the GPT-3.5-Turbo mannequin. Thereafter, we’ve now custom-built the code accordingly.
Step 1: Configure the Code Interpreter API
put in python and pip
To get began, it is advisable have Python and Pip put in in your PC. If you have not entered them but, you may observe our linked tutorial for steering. Through the set up course of, be sure to add Python.exe to your PATH.
Verifying Python and Pip Configuration
When you’re in Python and Pip, open Terminal and run the following instructions to ensure they’re arrange accurately:
– python mannequin
– Pip Mannequin
These directions ought to return their respective mannequin numbers, so affirm that Python and Pip are entered accurately.
Inclusion of Code Interpreter API
Subsequent, run the next command to put in the Code Interpreter API:
– Handle pip code interpreters
getting an api key
After setup is full, go to the OpenAI site and buy an API key. Click on Generate New Secret Key and repeat the required issue.
Step 2: Run ChatGPT Code Interpreter With out Spending a Dime
Making ready code editor
To run the Code Interpreter API utterly freed from cost, open a code editor like Fashionable Textual content Content material or Notepad++ and proceed to the following step.
Embody code and make changes
Copy the code under and paste it into the code editor. This code comes from the Code Interpreter API GitHub webpage, nevertheless we made some adjustments to forestall potential errors:
`Python
import work system
os.environ(“OPENAI_API_KEY”) = “Paste the OPENAI API key right here”
import CodeInterpreterSession from CodeInterpreter
async def essential():
# create a session
session = CodeInterpreterSession(mannequin=gpt-3.5-turbo)
wait session.astart()
# Generate response primarily based on particular person enter
response = await session.generate_response(
Chart the worth of Apple inventory from 2007 to 2023 June
,
# Output response (textual content content material + photographs)
print(ai:, response.Content material content material content material)
Per file in response.data:
file.show_image()
#finish session
ready session.astop()
If __name__ == “__main__”:
import asyncio
# execute asynchronously
asyncio.run(essential())
,
Highlighted in purple all through the code are areas that want changes. First, paste your OpenAI API key within the second line. After you have got entry to the GPT-4 API, you may in all probability outline the gpt-4 mannequin on the ninth line. Within the fourteenth line, you may enter your query and an outline of what kind of graph you need to make.
Save this file as Chart.py in your desktop, ensuring it has a .py extension.
code execution
Open Terminal and run the following instructions one after the opposite in the other way:
1. CD Desktop
2. python charts.py
Give it a number of seconds and the Code Interpreter API will generate the specified graph for you. This course attracts on a variety of background suppliers, together with Langchain Brokers, Yahoo Finance info from the Web, Matplotlib for plotting charts, and extra. To see the detailed course of the background occasion, you may in all probability add the following line to your code:
– “`os.environ(“VERBOSE”) = “True””`
From this level ahead, you may in all probability edit the question all through the code and re-run the Chart.py file to generate new charts.
Step 3: Contemplate the data utilizing the Code Interpreter API
group of data teams
If you wish to carry out information evaluation utilizing your private native information, begin by making a folder named Evaluation in your desktop.
with dataset
Subsequent, swap your dataset to the evaluation folder. The dataset might be in CSV, XSL or XSLX format. For instance, suppose you now have a file named GlobalTemperature.csv within the Evaluation folder.
modification to the code
Open the code editor and paste the following code:
`Python
import work system
os.environ(“OPENAI_API_KEY”) = “Paste the OPENAI API key right here”
import CodeInterpreterSession from codeinterpreterapi, file
async def essential():
# Supervisor context for automated session begin/finish
async with CodeInterpreterSession(mannequin=gpt-3.5-turbo) as session:
# Outline the request of the particular person
user_request = Analyze this dataset and plot worldwide temperature for 12 months from 1950 to 2016. Contemplate the GCAG system.
data = (file.from_path(“globaltemperature.csv”)),
# generate response
response = session prepared.generate_response(user_request, data=data)
# ship reply to particular person
print(ai:, response.Content material content material content material)
Per file in response.data:
file.show_image()
If __name__ == “__main__”:
import asyncio
# execute asynchronously
asyncio.run(essential())
,
Be certain that to stick your OpenAI API key, identical to the code above. Moreover, swap out globalTemperature.csv along with your dataset identifier. You can too modify the mannequin and particular person queries to fit your particular wants.
Save this file as data.py within the evaluation folder in your desktop.
how the code works
Launch Terminal and run the following instructions:
1. CD Desktop/Evaluation
2. python data.py
Due to this, you’ll get a graph primarily based in your authentic dataset. You might in all probability successfully use the Code Interpreter API for dataset evaluation at no cost.
conclusion
On this tutorial, we discover one of the best ways to make use of the utterly free code interpreter, profiting from the open-source implementation developed by Shroomnik. By utilizing the Code Interpreter API, utterly free opcode streamlining and information evaluation, you may reap the benefits of ChatGPT’s code interpreter capabilities with out the monetary burden of a paid subscription.
Steadily Requested Questions (FAQs)
1. Can I reap the benefits of OpenAI’s code interpreter with out spending a single penny?
In spite of everything, it’s best to be capable to use Code Interpreter completely freed from cost by following the directions on this tutorial. The open supply implementation developed by Shroomnik means you could profit from the choices of the code interpreter with out incurring any price.
2. What’s the worth of the OpenAI code interpreter?
OpenAI’s code interpreter is out there to paying prospects at a value of $20 for 30 days. Nonetheless, this tutorial guides you on one of the best ways to make use of it utterly freed from price by profiting from the open supply implementation.
3. What is required to make use of the free code interpreter?
To make use of Code Interpreter without cost, it is advisable have Python and Pip put in in your pc. Moreover, you’ll need an OpenAI API key, which might be obtained from the OpenAI web site.
4. Can I leverage my dataset for info analysis with Code Interpreter?
In the end, you may want to make use of your private dataset for info analysis with the code interpreter. The tutorial supplies detailed steering on the best way to set up an evaluation utilizing your authentic information in CSV, XSL or XSLX format.
5. What modes are supported by the Code Interpreter API?
The code interpreter API helps quite a lot of fashions, together with GPT-3.5-Turbo and presumably GPT-4. You may modify the code given within the tutorial to reap the benefits of the completely different templates as per your wants.
[ad_2]
To entry extra info, kindly discuss with the next link