Generative AI took the internet by storm in late 2022 when OpenAI released ChatGPT to the public. Since then, it has been a foot race for companies to incorporate Generative AI into their products, mainly driven by customers wanting to take advantage of this emerging technology.
It’s hard to go even a day without someone promoting their “must have” Gen AI “cheat sheet” on LinkedIn and other social media platforms. All of which are promising to make you the most efficient person on the planet. Well today I thought I’d bring you something a little different. Something that will hopefully get the creative juices flowing.
I want to introduce a concept that may or may not have legs, and one which may have already been explored elsewhere. Meta APIs. Nothing to do with Meta/Facebook, but more literally, an API within an API. Specifically, an API within the ChatGPT API.
ChatGPT is extraordinarily good at following instructions and providing a response. But no one said that the response has to come in the form of full sentences and paragraphs. Let’s look at an example of where we could apply this.
ChatGPT has a decent reputation for understanding text and language, so why not take that to the next level and ask it to provide sentiment analysis on a piece of text, in this case a random review of a tourist attraction.
OK, so we can see it’s done a good job of determining the negativity of a review. It even backs up it’s reasoning for this and summarises the content of the original text. BUT, it’s not exactly looking like an API response.
As mentioned earlier, ChatGPT, is very good at following instructions. So far We’ve given it just one instruction, we can add more.
Getting closer! We can see some numbers in there now meaning that if we were using this as an integration source we could do something programatic, but it’d be nice to see each of those numbers backed up by evidence.
OK, now we are getting somewhere, but the big issue now is that it’s still not really in a form that we can work with programatically. The ideal form of the response would be in something like JSON. We can tell ChatGPT to provide a response in JSON.
Unfortunately, there are two issues with this . The first and most obvious issue is that the JSON is surrounded by other text explaining what the JSON means. The second, slightly less visible issue is that the schema of the JSON that has been returned, could change at any point when we make a call. We can fix both of these issues by being very prescriptive in our prompt.
There we have it. We can turn ChatGPT into our very own low-code/no-code API development tool. We can use the OpenAI API to perform these calls and therefore make real world use of these in our applications.
Using a tool like Postman, you can see how this same prompt can be leveraged on the OpenAI API.
I hope that has given some food for thought. I’m sure there are plenty of other applications for this, especially now that ChatGPT is gaining access to the wider internet.