How to Turn Siri into a Boston Native with ChatGPT

A Step-by-Step Guide to Adding a Boston Accent to Siri Using Shortcuts & the OpenAI API

Ivan Campos
Sopmac Labs
Published in
8 min readFeb 7, 2023

--

Here’s a video to show what we will create:

Note: If you’d like to follow along with the iOS Shorcuts solution during this tutorial, download the Shortcut from iCloud: https://www.icloud.com/shortcuts/e5f59b77aa9c4910bf516e02ac6a4f81

Gone are the days when having a butler or personal help was reserved for the elite. With the democratization of these services, the once unattainable experience of having a personal assistant to attend to your every need has become accessible to the masses. No longer are the privileged few the only ones who get to enjoy the convenience of having a butler. Now, anyone can have the support and assistance of their own personal help, and daily life is all the more manageable for it.

For example, Siri allows you to delegate and automate tasks and functions, such as:

  • Scheduling and managing your daily routine and calendar
  • Sending messages and making phone calls hands-free
  • Setting reminders and alarms
  • Getting directions and navigation assistance
  • Accessing information and answering questions on a variety of topics, such as weather, sports, and news

…but, can Siri speak with a Boston accent?

Getting a Taste of Boston in Your AI Conversations

ChatGPT is now THE fastest growing app of all time.

Underneath ChatGPT is a Large Language Model (LLM) called GPT-3 (Generative Pretrained Transformer — version 3). Let’s see how we can make it respond in a Boston accent using the OpenAI API.

Generative Art of Boston from @SopmacArt on twitter. #Midjourney

Prompt Engineering a Boston Accent with GPT-3

OpenAI Playground: https://platform.openai.com/playground

Prompt: using a Boston accent, replacing “ar” with “ah”, “or” with “ow”, “er” with “ah”, and incorporating Boston words, respond to this: {your request}

GPT-3 Samples

  1. For request: “Where should I go to eat in Boston?” The response is:

2. For request: “Is Boston Harbor near Medford?” The response is:

3. For request: “Did you drink from the water bubbler at Harvard Square?” The response is:

A Low-Code Solution to Integrating GPT-3 with Siri

We’ve confirmed that our prompt is functioning properly. Now, let’s utilize the OpenAI API to bring our vision to life. Just as personal butler services have become more widely available, we can use a low-code tool to make our solution accessible to both developers and non-technical users. This way, we can democratize the process and ensure that everyone has the ability to use and benefit from our solution.

iOS Shortcuts

iOS Shortcuts can be considered a low-code solution as it provides a way for users to automate and streamline tasks and actions on their iOS devices (iPhone, iPad, Macbook, and Apple Watch) without having to write any code. The Shortcuts app allows users to create custom shortcuts using a visual interface and a drag-and-drop interface. This makes it easier for non-technical users to automate tasks, such as sending messages, launching apps, making phone calls, and more, without the need for coding knowledge.

Making the call to OpenAI with Shortcuts

Before we start, let’s save the request for Siri in a variable called “Request”. We will use this variable as the input for the OpenAI API.

We will access the OpenAI API using the “Get contents of URL” action, as shown below. The OpenAI API completions endpoint generates text predictions based on the input provided, enabling users to receive text completions for a given prompt.

Note: we could just prepend our Boston accent prompt into the prompt field, followed by the “Request”, but we will introduce the Boston accent shortly.

Now that we have the API’s response, let’s extract only the generated text. The API’s documentation shows it should look like this:

{
"choices": [
{
"text": "The OpenAI API completions endpoint provides text completions based on the input prompt."
},
{
"text": "The endpoint generates text predictions for given input, making it easier for developers to generate text-based content."
},
{
"text": "It helps in creating coherent and meaningful text based on the input, making text generation more efficient."
}
]
}

The returned content is in JSON format with “text” items in a “choice” collection. We can use 3 Actions in Shortcuts to get the first choice and save its value.

Siri Speaks

Now let’s have Siri speak with the “Speak” Action.

Name your Shortcut

Siri will use the shortcut’s name as the wake word to trigger the Shortcut. Some name ideas to get you started: Alfred, Geoffrey, and J.A.R.V.I.S.

Alfred, Geoffrey, and J.A.R.V.I.S.

Adding the Boston Accent

As shown below, we have stored the Boston Accent prompt in Text as a combination of our prompt and what was said to Siri.

For the demo, Siri will speak with a Boston accent only if the request includes a word from a wicked word list.

Before making the API request, we use Actions to conditionally use the combined text prompt instead of just what was dictated to the assistant.

Siri now speaks with a Boston accent!

EXTRAS — Personality

We love giving human-like qualities to our digital helpers, so why not add some fun and unpredictability to their responses? Introducing randomness and variability to your AI assistant will make them feel more real and unique, elevating your user experience to new heights. Let’s give our AI creations the individuality they deserve and enjoy a more personalized digital experience.

Cortana, Alexa, and Siri

Custom Greeting

Let’s make the Shortcut wake up and respond with different greetings each time. We’ll create a list of greeting words/phrases for the Shortcut. These actions occur before the “Request” variable is created, and you can see how the “Greeting” is used. The image shows our list of greeting options and how to randomly choose one and store it in the “Greeting” variable.

After saving in the Shortcuts app, you now have a working Shortcut that acts as a personal assistant and provides AI answers like ChatGPT.

Small Talk

Add even more human-like charm to your personal assistant with a touch of small talk. After making a request, your digital helper can engage in a friendly conversation, making the experience more personal and enjoyable. This extra layer of interaction will bring your AI assistant to life, enhancing your overall experience and providing a touch of anthropomorphic goodness.

After setting the “Request” variable, a list of potential small talk topics can be randomly selected and spoken before calling the OpenAI API to improve the flow of the interaction.

EXTRA — Siri Accessibility

Did you know you can access Siri by tapping the back of your iPhone?

iPhone Back Tap. Source: procamera-app.com

Here’s how:

  1. Go to the “Settings” app on your iPhone
  2. Tap on “Accessibility”
  3. Scroll down and select “Touch”
  4. Scroll down to the “Back Tap” option and tap on it
  5. Choose either “Double Tap” or “Triple Tap”
  6. Tap on “Siri” in the list of available actions
  7. Siri will now be activated when you perform the designated number of taps on the back of your iPhone.

Conclusion

ENTERING YOUR OWN OPENAI API KEY

️⚠️ ️You need to enter your own OpenAI API Key as the Authorization Value before running the Shortcut. ⚠️

To find your key, sign up for an OpenAI API account at https://platform.openai.com/account/api-keys.

For example, if your Key is sk-abcd12345, the Authorization Value would be: Bearer sk-abcd12345

If the API Key is NOT set properly, you will receive the following error:

OpenAI API Pricing

It’s worth mentioning that using the “text-davinci-003” model does cost $0.02 per ~750 words processed. For a detailed cost breakdown, read this.

Link to the Shortcut

Here’s a link to the Shortcuts app with all the information we discussed: https://www.icloud.com/shortcuts/e5f59b77aa9c4910bf516e02ac6a4f81

Be sure to click “Get Shortcut” on the inital window and then “Add Shortcut” to have a copy of the Shortcut saved on your device.

Yes, this is the correct spelling of Jarvis in Boston :)

Now go and have a wicked pissa wit yah shawtcut.

Related Resources

--

--