Cherysun’s Tech Cafe

ChatGPT Siri Shortcut

Talk to ChatGPT with Siri shortcuts on iOS, macOS, and watchOS devices. This open-source project is lightweight and highly customizable.

Features

  • Supports both the OpenAI API and Microsoft Azure OpenAI Services API.
  • Conduct conversations through text or with full voice input and output via Siri.
  • Available on iOS, macOS, watchOS, and can be used with Siri through voice on HomePod and CarPlay.
  • Automatically saves conversation logs in Markdown format (by default, logs are only saved for one day, but Advanced Configuration allows customization for any duration), and calculates the number of tokens used and corresponding cost.
  • Localization support: currently available in 🇬🇧 English, 🇪🇸 Español, 🇫🇷 Français, 🇵🇹 Português, 🇨🇳 简体中文 and 🇹🇼 繁體中文.

Privacy

  • No app installation required and no data is uploaded, only except for your prompt and calls to the official API. There is no developer data tracking and your personal information is never collected. Everything is transparent.
  • Eliminates any risk of your API keys being exposed.

Prerequisites

1. Apply for your API key:

  • OpenAI: You can find your API key or create new secret keys in User settings. Please confirm that your country is on the list of supported countries by OpenAI, as failure to do so may result in your API key not working or violating OpenAI’s terms and policies.
  • Microsoft Azure OpenAI Service: If you have an Azure subscription, you will need to submit an additional request and wait for approval before deploying the model. You can find the Endpoint and keys in the Resource Management section. You can use either KEY 1 or KEY 2.

2. Enable iCloud:

ChatGPT Siri shortcuts store log files in the Shortcuts folder on iCloud Drive, named ChatGPT.md. Therefore, you need to sign in to your Apple ID and enable iCloud on your device. Unless you manually update the log file storage location in the shortcut and change it to another directory on your device.

Installation

To allow third-party shortcuts from outside the Gallery to run on your iPhone, iPad, or Mac, you need to enable Private Sharing settings for the Shortcuts app. Please refer to: https://support.apple.com/guide/shortcuts/adjust-privacy-settings-apd961a4fc65/ios

  • On your iOS or iPadOS device, go to Settings > Shortcuts and then turn on Private Sharing.
  • On your Mac, choose Shortcuts > Settings from the menu bar (at the top of the screen). In the General pane, select Private Sharing.

Next, download the ChatGPT Siri Shortcut here and add it to your Shortcuts app.

Then, you need to answer three questions to initialize the shortcut. Skipping this setup will prevent you from using the shortcut correctly.

1. Language settings:

Enter the ISO 639-1 standard code for the language you want to use. Currently supported languages are English (en), Spanish (es), French (fr), Portuguese (pt), Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW). The en is the default option.

2. Chat completion API endpoint:

  • The OpenAI API endpoint https://api.openai.com/v1/chat/completions is the default option, and no modification is required if you plan to use it.
  • For Microsoft Azure OpenAI Service, the API endpoint depends on your Azure account configuration and has the format https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/completions?api-version={api-version}. Refer to the Prerequisites section for instructions on using your key to send requests to your API endpoint.

3. API key:

If you choose to use the OpenAI API endpoint, your key should start with sk-. For Microsoft Azure OpenAI Service, the key is a randomly generated string. Refer to the Prerequisites section for instructions on how to apply for an API key.

Usage

You can use the shortcut in the following four ways:

1. Direct use:

Open the Shortcuts app and select Ask AI, then start a conversation with ChatGPT. It supports continuous conversation with context until you exit the current session. By default, your session history is saved in Markdown format in the ChatGPT.md file in the Shortcuts folder.

2. Share sheet:

You can choose to share a piece of text or a Safari webpage with the shortcut, then select how you want it to handle the content. The shortcut provides four preset methods to handle shared content: Translate from / to…, Summarize and provide an abstract, Polish and edit, and Analyze and interpret code. You can also select Customize to describe any other ideas you have.

3. Use Siri with your voice:

You can use “Hey Siri, ask AI” to launch the shortcut, wait for Siri to respond with “What can I help you with?” and then start your conversation. Siri will speak ChatGPT’s response through voice and prompt you with “Please continue…” to indicate it is waiting for your subsequent language input. You can use commands such as “Cancel” or “Quit” to terminate the conversation.

4. Use on your Apple Watch:

For usage on watchOS, please refer to: https://support.apple.com/en-us/guide/watch/apd99050d435/watchos

License

This project is licensed under the GNU AGPLv3 license. See the LICENSE file for details.

感谢您的支持与贡献

您的捐款将使您阅读到的内容变得更好。

支持微信支付和支付宝。

感谢您的支持与贡献

您的捐款将使您阅读到的内容变得更好。

触摸并按住二维码,选择识别图中二维码