Lee Mallon
Lee Mallon

Follow

Lee Mallon

Follow
What if we just used chatGPT as an API to the internet?

What if we just used chatGPT as an API to the internet?

Lee Mallon's photo
Lee Mallon
·Apr 11, 2023·

2 min read

Play this article

I give you generative APIs

I love drinking the kool-aid of this new AI age but in the hype cycle we are currently in there is a lot of noise and tools like chatGPT are being overlooked for more simple yet powerful tasks such as acting as an API to the internet.

In this video, I walk through how I iterate on a series of prompts to create an API that itself was written with chatGPT and returns chatGPT generated data in a format (JSON) that can be understood by other systems or to go in a crazy inception loop may be read by chatGPT. It’s all very inception!

You can read through the slides or watch the video below.

Video: https://youtu.be/UdwP1OZxNU0

Slides

https://promptapidemo.kidventuresai.com/api/promptapi

https://promptapidemo.kidventuresai.com/api/promptapi

The final prompt:

Create a JSON object containing a list of the 10 most populated cities in the world, sorted alphabetically by city name. For each city, include the following properties:

  • id: an incremental number from 1 to 10

  • city_names: a list of dictionaries, where each dictionary has the keys language and name, and contains the name of the city in English, French, and German

  • country_name: the name of the country the city is located in

  • city_population: the population of the city

  • description: a one-line sentence describing the city

  • createdOn: a random date and time in March 2023

  • imageUrl: a URL pointing to an image of the corresponding country

  • hash: a MD5 hash of the country_name

The JSON object should have a top-level property called createdOn, which is a string representing the date and time when the JSON object was created.

The api to see the magic:

https://promptapidemo.kidventuresai.com/api/promptapi

Contact

I would love to hear any feedback/comments on this concept of creating generative AI APIs.

Or if you need any support with your AI strategy please get in touch at leemallon.com.

 
Share this