Member-only story
Writing a ChatGPT Plugin With Go
How I wrote a Singapore HDB car park availability ChatGPT plugin

UPDATE: My HDB Car Park plugin has been approved on the ChatGPT plugin platform as on 3 June 2023
One of the side perks of my new job is, occasionally, I get access to some cool new technologies to try out. One such technology recently is OpenAI’s ChatGPT plugin platform.
ChatGPT is a breakthrough AI chatbot that has taken over the world by storm, for good or bad. The announcement of ChatGPT plugins and a plugin platform in March 2023 was met with continuous collective gasps (mine included). This is a big deal.
If you equate releasing ChatGPT to releasing the iPhone in 2007, then announcing plugins is like announcing the mobile apps and App Store in 2008. Not only is this a platform to develop services using one of the most powerful and advanced AI models today, but it is also an opportunity to have immediate access to 100 million users.
To a programmer like me, this is like catnip to a cat, so I leapt at it once I got my grubby hands on the access.
ChatGPT plugins are pretty straightforward. In fact, they are nothing more than APIs that ChatGPT will call and get information, which they can then use to provide answers back to the users. Yes, you read it correctly; ChatGPT plugins are just standard APIs.
So what makes ChatGPT plugins, plugins, then? ChatGPT plugins must have provide 2 documents:
- A manifest file (essentially a JSON file) that describes the plugin
- An OpenAPI specification (a YAML file) that describes the APIs in the plugin
Let’s go through how I created the Singapore HDB car park availability plugin.
The car park plugin
I decided to start with a very simple plugin. In Singapore, the Housing Development Board (HDB) is a government agency responsible for public housing. Public housing is a big thing in Singapore. About 80% of people in Singapore live in public housing, so HDB car parks represent the bulk of the residential car parks in Singapore.
I wanted to create a plugin that can tell me about HDB car parks in Singapore and their…