ChatGPT, powered by OpenAI, has introduced an exciting capability – Code Interpreter. This new feature allows ChatGPT to execute Python code, providing an interactive programming environment. In this tutorial, we will show you how to use the ChatGPT Code Interpreter to read data from a spreadsheet and generate content based on the extracted data. In this case, we will be using the feature to write a blog post based on survey responses.
First, go to the ChatGPT website and log in. Make sure you have access to the Code Interpreter feature. At the moment, Code Interpreter is only available for ChatGPT Plus subscribers.
Once you’re in the ChatGPT interface:
After uploading the spreadsheet, you will want to type in your prompt. Nailing the prompt is key to getting the most out of Code Interpreter. Ideally, you want the prompt to be long, detailed, and contain precise instructions on what you want your content to look like. In my case, I am using this spreadsheet to write a blog post based on survey responses.
For this, I’ll obtain an example of another blog post that I want mine to be similar to. Then, I’ll start off the prompt with “I am writing a blog post where I interview ChatGPT plugin developers. This one mainly focuses on the biggest challenges that developers face during the process. It’s part of a 3-part series. Here are the other two that I already wrote:” Here, I would paste the completed blog post.
At the end of the prompt, I finished with “I want you to write me a new blog post with quotes from the developers in the spreadsheet I attached. I want it to be in the same format as the other two. I want it to focus on the development process and the biggest challenges faced. If someone was already quoted in the other two, don’t quote them again.”
I found my first prompt to be effective, however, the blog post still needed some work. ChatGPT didn’t follow my commands perfectly, and began mentioning the names of people without attaching a quote to them. This was not something I wanted, and I explicitly told it not to do this.
Another problem I ran into was the fact that it was making up quotes from made-up people. That seems crazy, but I asked it to write 10 more quotes within one of the sections of the post. It complied with that request, but the people it quoted were not in my spreadsheet, and, most of them were not even real.
Now, maybe some of those people are real. I don’t know. But, they were not included in my data, so I imagine ChatGPT pulled them off the internet, along with the quotes. This represents one of the biggest challenges to Code Interpreter. Hallucinations have been a problem for ChatGPT, and that seems to be the case with Code Interpreter. It is vital that you explicitly tell the bot what you want it to do, and when it gets something wrong, make it clear in your response.
ChatGPT’s responses will strongly depend on how you phrase your prompts and responses. If you’re not getting the results you want, rephrasing your prompt or asking for information in a different way is key. The more specific and detailed you can be in your prompt, the better ChatGPT will be able to generate the content you’re looking for.
As you continue to rephrase, one strategy you could try is to focus on one section of your post at a time. If you give ChatGPT specific instructions for how you want to change each section (one at a time), it will be easier for ChatGPT to generate the specific post that you want. I also highly recommend pasting the results into a Google or Word doc and editing them there, rather than just pasting them into your blog or website directly from ChatGPT
It’s important to remember that this new feature is in beta. It will not always work the way you want it to, and that’s to be expected. The key is to keep rephrasing your prompts, and to be on the lookout for hallucinations. Remember, practice makes perfect. Don’t be afraid to experiment, it will help you get the most out of ChatGPT and Code Interpreter.