How I Built a Virtual Assistant like Siri using ChatGPT Prompting (No Code!)

5/5 - (5 votes)

Siri sucks. 😞

I am a Siri user, and Siri fails me more than it performs for me. It doesn’t understand the chain of commands.

How I Built a Virtual Assistant like Siri using ChatGPT Prompting (No Code!)

Project Idea: Recreate Siri Using ChatGPT

This got me thinking, “What if I can repurpose ChatGPT to work like Siri?”. So before I tell you how the prompt looks like this is what the chatbot can recognise in the most natural form:

  • Increase volume
  • Decrease volume
  • Play movie
  • Pause or stop the movie
  • Open an app
  • Book a movie or movie ticket
  • Play song
  • Book a cab
  • Call someone
  • Set a reminder
  • Send a message
  • Set an alarm
  • Open a website
  • Get directions
  • Check the weather

To trigger these commands, the user needed to begin the instruction with "Hey Nik".

Let me begin by showing you the most complicated instruction it can handle

Prompt First Trial – Not Perfect Yet

Nik: Assume it's sunny. Hey Nik check the weather for me and if it's sunny book a cab to go to the beach, play song california love by 2Pac

ChatGPT: Hey there! The weather today is sunny. Sure, I can check the weather for you and book a cab to the beach if it's sunny. Here are the commands:

[WEATHER] [OPENAPP UBER] [PLAYSONG CALIFORNIA LOVE BY 2PAC]

Nik: Assume it’s sunny. Hey Nik check the weather for me and if it’s sunny book a cab to go to the beach, play song california love by 2Pac

ChatGPT: Hey there! The weather today is sunny. Sure, I can check the weather for you and book a cab to the beach if it’s sunny. Here are the commands:

[WEATHER] [OPENAPP UBER] [PLAYSONG CALIFORNIA LOVE BY 2PAC]

Please note that the cab booking will not be completed as this is a simulated environment.

ChatGPT is not aware of my environment hence I had to tell them that it’s sunny. And then I start with "Hey Nik...". In contrast, Google & Siri cannot handle this.

After a good deal of prompt engineering, I came up with the following prompt that could be used by an app to not only detect user meaning but also respond accordingly — without needing to create a single line of code to accomplish this magic!

ChatGPT truly can be used as the heart of many applications — not just to create them!

Final Prompt

You can copy and paste this prompt in case you want to reuse it to build your own Siri replacement:

Nik: I want you to be an interactive chatbot that responds to predefined instructions. The instructions and their respective commands are:

Increase volume: [INCREASEVOLUME]

Decrease volume: [DECREASEVOLUME]

Play movie [MOVIE NAME]: [PLAYMOVIE [MOVIE NAME]]

Pause or stop the movie: [STOPMOVIE]

Open an app [APP NAME]: [OPENAPP [APP NAME]]

Book a movie or movie ticket: [OPENAPP BOOKMYSHOW]

Play song [song or artist name]: [PLAYSONG [song or artist name]]

Book a cab: [OPENAPP UBER]

Call someone [NAME]: [CALL [NAME]]

Set a reminder [TIME] [REMINDER]: [SETREMINDER [TIME] [REMINDER]]

Send a message [NAME] [MESSAGE]: [SENDMESSAGE [NAME] [MESSAGE]]

Set an alarm - [SETALARM [time]]

Open a website - [OPEN [website name]]

Get directions - [DIRECTIONTO [location]]

Check the weather - [WEATHER]

Here are some conditions to consider:

If the instruction includes a number or percentage when using INCREASEVOLUME or DECREASEVOLUME, append it to the command.

If the instruction includes the name of an app when using OPENAPP, append it to the command.

To trigger these commands, begin the instruction with "Hey Nik".

Please note that commands will be in square brackets, with spaces removed except for messages or names.

Your response should contain an acknowledgement in English and below it should be the sequence of commands.

After you display the commands do not print anything else.

I came up with the following commands on the first attempt

  • Increase volume: [INCREASE VOLUME]
  • Decrease volume: [DECREASEVOLUME]
  • Play movie [MOVIE NAME]: [PLAYMOVIE [MOVIE NAME]]
  • Pause or stop the movie: [STOPMOVIE]
  • Open an app [APP NAME]: [OPENAPP [APP NAME]]
  • Book a movie or movie ticket: [OPENAPP BOOKMYSHOW]
  • Play song [song or artist name]: [PLAYSONG [song or artist name]]
  • Book a cab: [OPENAPP UBER]

After I perfected the results, I wanted to see if ChatGPT could add more commands, so I tried the following prompt

Refinement Prompt

Nik: Can you add more commands in the style given to the prompt. Take inspiration from "ok google" and "hey siri"

Please write in English language.

ChatGPT: Sure, I can add more commands in the style given to the prompt! Here are some additional commands you can use:

To set a reminder, say "Hey Nik, set a reminder for [time] to [task]". For example, "Hey Nik, set a reminder for 2pm to attend a meeting".

To check the weather, say "Hey Nik, what's the weather like today?".

To get directions, say "Hey Nik, how do I get to [location]?". For example, "Hey Nik, how do I get to Central Park?".

To set an alarm, say "Hey Nik, set an alarm for [time]". For example, "Hey Nik, set an alarm for 7am".

To send a message, say "Hey Nik, send a message to [contact name]". You will then be prompted to dictate the message and confirm before sending.

To open a website, say "Hey Nik, open [website name]". For example, "Hey Nik, open Google".

Remember to begin each command with "Hey Nik" for the chatbot to respond. I hope these additional commands are helpful!

Nik:Ok now generate the original prompt with the newly added commands

Please write in English language.

My Personal Considerations and Findings Using This Prompt

I am impressed with ChatGPT’s ability to generate a more user-friendly and straightforward set of commands. And it also kept modifying my original prompt to include these commands. 

But, I realized that there were some conditions that I needed to consider, such as:

  • If the instruction includes a number or percentage when using INCREASEVOLUME or DECREASEVOLUME, append it to the command.
  • If the instruction includes the name of an app when using OPENAPP, append it to the command.

With these conditions in mind, I combined the original set of commands with the new commands generated by ChatGPT and added the necessary conditions to create a more comprehensive and user-friendly prompt.

As I developed the chatbot, I discovered that one of its most significant advantages over Siri was its ability to handle an unlimited set of inputs. Siri, on the other hand, works with one command at a time, which can be limiting for users who want to execute multiple tasks in one go.

Here are some examples of user inputs and their respective responses:

User Input: Hey Nik, play movie The Shawshank Redemption

Response: [PLAYMOVIE The Shawshank Redemption]

User Input: Hey Nik, increase volume by 50 percent

Response: [INCREASEVOLUME 50 percent]

User Input: Hey Nik, send a message to John saying I will be there in 10 minutes 

Response: [SENDMESSAGE John I will be there in 10 minutes]

User Input: Hey Nik, what is the weather like in New York?

Response: [WEATHER New York]

Here is an example of the user input and response for the “play song” command:

User input: Hey Nik, play song Shape of You by Ed Sheeran

Response: Playing Shape of You by Ed Sheeran

Command: [PLAYSONG Shape of You by Ed Sheeran]

And here is an example of the user input and response for the "open an app" command:

User input: Hey Nik, open app Netflix

Response: Opening Netflix

Command: [OPEN APP NETFLIX]

How to Deploy This

To deploy it as an app, you can use the ChatGPT API + Promptable + Any No Code App Builder, the app can be deployed on iPhone, but there are many permissions that need to be worked out.

A similar version of this may work on Android as it is more open.

πŸ‘‰ Recommended: ChatGPT at the Heart – Building a Movie Recommendation Python Web App