TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Software Development

How OpenAI Ruined My Homework Assignment but Helps Coders

OpenAI released ChatGPT this week to much fanfare. We explore the fun developer-focused tools the AI company offers in its playground.
Dec 8th, 2022 9:22am by
Featued image for: How OpenAI Ruined My Homework Assignment but Helps Coders

OpenAI has ruined my favorite assignment from when I was (briefly) a high school English teacher: Come up with a two-sentence horror story. All you really need to do the assignment is a topic and an idea of what’s frightening. It seems so… human and creative, and yet, OpenAI does it better than most of my high school students ever did.

What does OpenAI, which launched ChatGPT to much fanfare last week, offer developers? I fell down a rabbit hole exploring the private artificial intelligence company’s playground options. And while they may have ruined my 2018 teaching curriculum for Halloween — as well as any essay plans I may have had — they actually offer some interesting solutions that might help developers do their job; assuming you verify the results first, since currently, it has a propensity for generating errors.

Translating

There are several translation functions, including (of course) one for human languages. But for coders, one useful translation function is this playground, which takes a complicated piece of code and explains what it does in English. Just put the code in and it will create a nice summary for your comments. This is free and relies on Codex models currently in beta. On a related note, it will also translate from one programming language to another, so developers can use the comments to specify the source and target languages.

Python to Javascript

Image via OpenAI playground screenshot

In that same vein, you can play with:

Fixing

One of the more intriguing uses of AI is its ability to fix problems. Granted, the newly released OpenAI chatbot ChatGPT made headlines mostly for its mistakes — including describing absolute monarchy supporter Thomas Hobbes as a federalist — but it’s learning. Or at least OpenAI wants developers to help it learn — they’re running a feedback contest through Dec. 31, 2022.

Other “fixing stuff” offerings are its Python bug fixer and the ability to parse unstructured data into tables from the long-form text, which it does by allowing the developer to specify a structure and supply some examples.

Creating

When it comes to creation, we’d like to think we can one-up artificial intelligence. And we can … for now. But several OpenAI projects are actually aimed at creating code out of natural language.

One feat that attracted quite a lot of media attention this week was the ChatGPT’s ability to mimic a linux virtual machine. There’s also a playground model that will create code to call the OpenAI API using natural language instructions. It’s in beta for now.

This playground will calculate the time complexity of a function. Another model creates simple SQL queries. It demos the creation of a SQL request to find all users who live in California and have over 1000 credits, but it functions like the other playground in that you can substitute your own SQL requests to build a function.

For those who need to implement the payment functionalities of Stripe, there’s a model that creates the code to call the Stripe API using natural language.

Finally, there’s a code generation model that will create a Python docstring for a given Python function. “We specify the Python version, paste in the code, and then ask within a comment for a docstring, and give a characteristic beginning of a docstring (“””),” the playground explains.

Learning

For my money, artificial intelligence is at its best when it helps humans. OpenAI currently has a few models designed to help programmers learn how to do better, including a JavaScript helper chatbot that can answer questions about using JavaScript. It uses a few examples to get the conversation started.

And in a meta offering, OpenAI also includes in its examples a machine language/AI language model tutor. Basically, it’s a chatbot that answers questions about language models.

Weird

If those use cases and examples aren’t intriguing enough to lure you in, then there’s a category of models I’m just calling “weird.” For instance, one model converts movie titles into emoji. You can see what that looks like in the accompany image — I added The Good, The Bad, The Ugly.

model converts movie titles into emoji

Image via screenshot of OpenAI playground

And if all of this fails to amuse you, there’s always Marv the sarcastic chatbot. It probably wasn’t modeled on Marvin the Paranoid Android from The Hitchhiker’s Guide to the Galaxy, but it does a darn good impression.

ChatbotMarv sample

Image via OpenAI playground screenshot

Group Created with Sketch.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.