Find Federico on MastodonFind John on MastodonFind Alex on MastodonFind Club MacStories on Mastodon

April 13, 2023

The Making of S-GPT, Part 1: Using the ChatGPT API with Apple's Shortcuts App to Have Conversations with OpenAI's Assistant

Last week on MacStories, I published S-GPT, an advanced shortcut for ChatGPT that lets you have conversations with OpenAI’s powerful assistant while also leveraging native integrations on Apple platforms. S-GPT supports native functionalities of iOS, iPadOS, watchOS, and macOS such as the system clipboard, Live Text, Reminders and Calendar, and even playlists in the Music app. This kind of access to the OS is what sets S-GPT apart from other shortcuts that communicate with the ChatGPT API; like I said last week, I have big plans to continue adding new system functionalities to S-GPT over the coming months.

Building S-GPT has been a fun, informative, and challenging experience for me for a few reasons: I’d never worked with the latest ChatGPT conversational API before, and I had the idea of adding native integrations to the shortcut after I’d already started working on it. In doing that, however, I learned from my previous mistakes: I knew this was going to become a complex shortcut over time, so unlike what I did years ago with MusicBot – and to avoid having to refactor the shortcut like I did with Apple Frames – I designed S-GPT with a “modular” structure that already supports future additions.

The result is, I believe, my best work in Shortcuts to date: even though the sheer number of actions is smaller than, say, Apple Frames, I find S-GPT’s design and underlying code more elegant, cleaner, and more future-proof than other shortcuts I’ve built. There were several things I learned in the making of S-GPT, and I employed a variety of advanced Shortcuts techniques and hidden tricks that I want to explain and demonstrate to Club MacStories+ and Premier members for the return of my Automation Academy.

With Automation April well underway, it’s my hope that you’ll be able to learn some high-level concepts in this class that can help you make even better and more powerful shortcuts for our contest and, broadly speaking, shine a light on some of Shortcuts’ more esoteric functionalities.

Let’s dive in.

This story is for Club MacStories+ and Club Premier members only.

Join the Club and get access now.

Already a member? Sign in