ShareShortcuts
Fork “Let’s Chat”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so knyl2013 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
37K
Saved
1
Actions
47
Category
API
Version
2.2
Language
EN

Features:

- GPT-3 powered chatbot (the same technology used by ChatGPT)

- Keep asking follow up questions

- Remember previous conversations even if it is closed

How to use:

1) Download the shortcut

2) Edit the shortcut

3) Replace with your openai key

3.1) You can get your api keys here https://platform.openai.com/account/api-keys

4) Run the shortcut manually by clicking the play button

5) Allow all accesses when it prompts

6) Say "Hey Siri let's chat"

7) Enjoy

p.s. conversation log will be saved in the clipboard, clear the clipboard or copy something else into it will clear previous conversation

Updates:

9 Mar:

1) Updated to use GPT-3.5 model. The price is 10% of the old model and should be better at chatting in general.

2) Feel free to change the system prompt to play with it (The text begins with "You are the AI who is helpful, creative, clever, ...")

3) Fixed double quote in question/answer that potentially leads to "What's the text" bug.

What's New

Version 2.2

Updated system prompt

Version History
2.2 Mar 9, 2023

Updated system prompt

2.1 Mar 9, 2023

Updated "ADD API KEY HERE" message

2.0 Mar 9, 2023

Updated to use GPT-3.5, the price is 10% of the old model and should be even better at chatting 🥳

1.2 Feb 26, 2023

Add support to Apple Watch

1.1 Feb 9, 2023

update continue conversation prompt text

1.0 Feb 8, 2023

First release

What it does

47 actions
  1. Text
  2. If
  3. Show Alert
    Add your API Key
  4. Stop This Shortcut
  5. If
  6. Text
  7. Set Variable
    system_prompt
  8. Text
  9. Set Variable
    messages
  10. Set Variable
    key
  11. Text
  12. Text
  13. Text
  14. Set Variable
    Conversation
  15. Get Device Details
  16. If
  17. Get Clipboard
  18. If
  19. Set Variable
    messages
  20. Set Variable
    prompt
  21. If
  22. Set Variable
    prompt
  23. If
  24. Set Variable
    prompt
  25. Repeat
  26. If
  27. Set Variable
    prompt
  28. If
  29. Ask for Input
    …
  30. Set Variable
    question
  31. Replace Text
  32. Set Variable
    updatedquest
  33. Text
  34. Add to Variable
  35. Text
  36. Get Contents of URL
    https://api.openai.com/v1/chat/completions
  37. Get Text from Input
  38. Get Dictionary Value
  39. Get Dictionary Value
  40. Get Dictionary Value
  41. Text
  42. Replace Text
  43. Set Variable
    updatedres
  44. Text
  45. Add to Variable
  46. Set Variable
    prompt
  47. Copy to Clipboard

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/web'
#include 'actions/text'
#include 'actions/sharing'
#include 'actions/device'
#define color violet
#define glyph musicWaveForm

const Text = "ADD API KEY HERE"

if Text contains "ADD API KEY HERE" {
	alert("Edit this shortcut and paste in your API Key ", "Add your API Key")
	stop()
} else {
}
@system_prompt = "You are the AI who is helpful, creative, clever, and very friendly. The human is using voice-to-text so the text might not be very accurate. Try your best to answer the question. Keep all answers in one paragraph."
@messages = ""
@key = Text
@Conversation = "Previous conversation detected from clipboard. You can ask the next follow up question or say 'Give me the summary so far'"
const DeviceName = getDeviceDetail("")

if DeviceName !contains "Watch" {
	const Clipboard = getClipboard()
	if Clipboard contains "\"role\": \"user\", \"content\"" {
		@messages
		@prompt
	} else {
		@prompt
	}
} else {
	@prompt
}

repeat _ for 999 {
	if !@prompt {
		@prompt
	} else {
	}
	prompt(@prompt, "Text")
	@question
	replaceText("(\“|\”|\")", "\'", @question, true)
	@updatedquest
	@messages += ",{\\"role\\": \\"user\\", \\"content\\": \\"{@updatedquest}\\"}"
	const Text1 = "{\n  \\"model\\" : \\"gpt-3.5-turbo\\",\n  \\"messages\\": [\n    {\\"role\\": \\"system\\", \\"content\\": \\"{@system_prompt}\\"} {@messages}\n  ]\n}"
	const ContentsOfURL = fileRequest("https://api.openai.com/v1/chat/completions", "POST", Text1, {
		"Authorization": "Bearer {@key}",
		"Content-Type": "application/json"
	})
	const Text2 = getText(ContentsOfURL)
	const DictionaryValue = getValue(Text2, "choices")
	const DictionaryValue1 = getValue(DictionaryValue, "message")
	replaceText("(\“|\”|\")", "'", true)
	@updatedres
	@messages += ",{ \\"role\\": \\"assistant\\", \\"content\\": \\"{@updatedres}\\" }"
	@prompt
	setClipboard(@messages)
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

You Might Also Like

See All
Advertisement