Integrating Siri and ChatGPT3 for Fun and Educational Conversations
-
Once you have your API key, launch the Shortcuts App on your phone.
-
Click the + to create a new shortcut
-
For your first action, choose Ask for Input. 4.
-
It should say Ask for “Text” with “Ask ChatGPT3?” This is what Siri will ask you when you call this shortcut. 5.
- At the bottom where it says “Search for Apps and Actions” type in Set Variable
-
Set Variable to “Prompt” to “Provided Input”
-
At the bottom, choose Get Contents From URL
-
Type in the URL in the open space: https://api.openai.com/v1/completions
-
Click the blue arrow and make yours look similar. The only difference is after Bearer in the “Authorization” key, you need to paste the API key you generated from OpenAI.
-
Type in get dictionary from “Contents of URL“
-
Set it to the following
-
Type in “Get Dictionary Value”
-
Get “Value” for “Choices” in “Dictionary”
-
Search “Get Dictionary From”
-
Set it to “Dictionary Value”
-
Search Dictionary From Input
-
Set it to: Get “Value for “Text” in “Dictionary”
-
Search “Speak Text”
-
Set it to Speak “Dictionary Value”
At the top of the screen, set the name of the shortcut to OpenChat.
Now ask Siri for Open Chat and you will be prompted with Ask ChatGPT3?
This is how it all looks.
TL:DR
If you want to avoid doing all the work, you can install this Shortcut.
Scroll down to the “Get Content from https://” and hit the blue arrow. Scroll down to Authorization and replace “yourtoken” with your API token.