Login About Gallery
ChatGPT 1.2.5
Accepts
Text
COMMENT
‎🤖️ ChatGPT Siri 1.2.5 🌐 Author Site: https://github.com/Yue-Yang/ChatGPT-Siri ⚠️ OpenAI API key acquisition steps: 1. Log in to https://platform.openai.com 2. Click on the avatar in the upper right corner and select "View API keys" 3. Click the "Create new secret key" button on the right side to generate API key 4. Copy the API key and paste it into the text box below
TEXT
‎Text
VARIABLES
‎Set variable ‎API-key ‎to ‎Text
TEXT
‎I am here, always at your service!
VARIABLES
‎Set variable ‎welcome-text ‎to ‎Text
TEXT
‎I have finished answering, please continue.
VARIABLES
‎Set variable ‎continue-text ‎to ‎Text
TEXT
‎Quit chat
VARIABLES
‎Set variable ‎exit-command ‎to ‎Text
TEXT
‎Okay, bye!
VARIABLES
‎Set variable ‎exit-text ‎to ‎Text
TEXT
‎New chat
VARIABLES
‎Set variable ‎new-chat-command ‎to ‎Text
TEXT
‎Ok, it's a pleasure to serve you again!
VARIABLES
‎Set variable ‎new-chat-welcome-text ‎to ‎Text
DATE
‎Current Date
TEXT
‎You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Knowledge cutoff: Sep 2021.
VARIABLES
‎Set variable ‎system-message ‎to ‎Text
LIST
SCRIPTING
‎Get ‎First Item ‎from ‎List
SCRIPTING
‎If ‎Item from List ‎is ‎gpt-4
NUMBER
‎512
VARIABLES
‎Set variable ‎max-tokens ‎to ‎Number
SCRIPTING
‎Otherwise
NUMBER
‎1024
VARIABLES
‎Set variable ‎max-tokens ‎to ‎Number
SCRIPTING
‎End If
DICTIONARY
VARIABLES
‎Set variable ‎request-body ‎to ‎Dictionary
TEXT
‎⚠️ API key invalid!
VARIABLES
‎Set variable ‎error-tittle ‎to ‎Text
TEXT
‎The API key is not set or set incorrectly. Would you like to open this Shortcut‘s tutorial page?
VARIABLES
‎Set variable ‎error-message ‎to ‎Text
SCRIPTING
‎If ‎API-key ‎begins with ‎sk-
SCRIPTING
‎Repeat ‎100 times
SCRIPTING
‎If ‎Repeat Index ‎is ‎1
VARIABLES
‎Set variable ‎input-tittle ‎to ‎welcome-text
SCRIPTING
‎If ‎Shortcut Input ‎has any value
VARIABLES
‎Set variable ‎shortcut-input ‎to ‎Shortcut Input
SCRIPTING
‎If ‎shortcut-input ‎is ‎new-chat-command
TEXT
‎Text
VARIABLES
‎Set variable ‎shortcut-input ‎to ‎Text
VARIABLES
‎Set variable ‎input-tittle ‎to ‎new-chat-welcome-text
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
SCRIPTING
‎Otherwise
VARIABLES
‎Set variable ‎input-tittle ‎to ‎continue-text
SCRIPTING
‎End If
SCRIPTING
‎Ask ‎input-tittle
Input Type
‎Text
Default Answer
‎[{'class': 'magic', 'value': 'shortcut-input', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
TEXT
‎Text
VARIABLES
‎Set variable ‎shortcut-input ‎to ‎Text
VARIABLES
‎Set variable ‎user-input ‎to ‎Provided Input
SCRIPTING
‎If ‎user-input ‎is ‎exit-command
SCRIPTING
‎Show ‎exit-text
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
SCRIPTING
‎If ‎user-input ‎is ‎new-chat-command
SHORTCUTS
‎Run ‎AI 助手
Input
‎new-chat-command
Show While Running
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
DICTIONARY
VARIABLES
‎Set variable ‎user-message ‎to ‎Dictionary
SCRIPTING
‎Get ‎Value ‎for ‎messages ‎in ‎request-body
VARIABLES
‎Set variable ‎request-messages ‎to ‎Dictionary Value
VARIABLES
‎Add ‎user-message ‎to ‎request-messages
SCRIPTING
‎Set ‎messages ‎to ‎request-messages ‎in ‎Dictionary
VARIABLES
‎Set variable ‎request-body ‎to ‎Dictionary
VARIABLES
‎Set variable ‎user-input-time ‎to ‎Current Date
URL
‎https://api.openai.com/v1/chat/completions
NETWORK
‎Get contents of ‎URL
‎Options Under Construction
SCRIPTING
‎If ‎Contents of URL ‎does not contain ‎"choices":
SCRIPTING
‎Get ‎Value ‎for ‎error.type ‎in ‎Contents of URL
SCRIPTING
‎Get ‎Value ‎for ‎error.code ‎in ‎Contents of URL
SCRIPTING
‎Get ‎Value ‎for ‎error.message ‎in ‎Contents of URL
TEXT
‎Dictionary Value ‎: ‎Dictionary Value ‎Dictionary Value
SCRIPTING
‎Show alert ‎Request Error
Title
‎Request Error
Show Cancel Button
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
SCRIPTING
‎Get ‎Value ‎for ‎choices.1.message ‎in ‎Contents of URL
VARIABLES
‎Set variable ‎response-message ‎to ‎Dictionary Value
SCRIPTING
‎Get ‎Value ‎for ‎content ‎in ‎response-message
SCRIPTING
‎Get ‎Value ‎for ‎usage ‎in ‎Contents of URL
VARIABLES
‎Set variable ‎usage-dictionary ‎to ‎Dictionary Value
VARIABLES
‎Set variable ‎chatgpt-output ‎to ‎Dictionary Value
VARIABLES
‎Set variable ‎chatgpt-output-time ‎to ‎Current Date
SCRIPTING
‎If ‎Repeat Index ‎is ‎1
TEXT
‎©️ChatGPT Shortcut 1.2.5 made by Yue Yang with ❤️, powered by OpenAI ChatGPT API gpt-3.5-turbo & gpt-4 model. Website: https://github.com/Yue-Yang/ChatGPT-Siri Twitter: @YueYangDev WeChat: YueYangDev -------------------------------- 💻 model: ‎Item from List ‎system-message
TEXT
‎/ChatGPT-log/ ‎Current Date ‎/ ‎Current Date ‎.txt
VARIABLES
‎Set variable ‎chat-file-name ‎to ‎Text
DOCUMENTS
‎Append ‎Text
Service
‎iCloud Drive
File Path
‎[{'class': 'magic', 'value': 'chat-file-name', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
Make New Line
SCRIPTING
‎Otherwise
SCRIPTING
‎End If
SCRIPTING
‎Get ‎Value ‎for ‎prompt_tokens ‎in ‎usage-dictionary
SCRIPTING
‎Get ‎Value ‎for ‎completion_tokens ‎in ‎usage-dictionary
SCRIPTING
‎Get ‎Value ‎for ‎total_tokens ‎in ‎usage-dictionary

Showcuts

Magic Vars

Screenshot

Submitted Anonymously 11 months ago

This is an old shortcut, so some variables might be missing!

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0

13 more actions