ShareShortcuts

Nina 9000 - chatGPT (GPT-3)

Nina 9000 is here

nikluz
Fork “Nina 9000 - chatGPT (GPT-3)”

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 nikluz 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
35K
Saved
0
Actions
50
Category
API
Version
1.0
Language
EN

Preview

Nina 9000 is here. Endless conversation mode activated.

In this version, Nina remembers up to the last 8 interactions during the course of any continuous conversation (better than most humans really). When 8 interactions is reached, each new interaction will drop the first of the last 8 interactions. This loop does not end until you press stop, or when you have nothing else to say.

This is the ULTIMATE version of Nina. The shortcut is very long and complex and I don't feel like explaining it except for... as a programmer, what a dog shit interface this is to create logic. Lucky for me, I was able to use a Macbook Pro to create this version (Thanks Mom). I would not have had the patience to create this in the mobile app.

Enjoy…. This is my last one (unless bug fixes are needed)

What's New

Version 1.0

First release

Version History
1.0 Jan 31, 2023

First release

What it does

50 actions
  1. Add to Variable
  2. List
  3. Add to Variable
  4. If
  5. Set Variable
    interactions
  6. Dictionary
  7. Add to Variable
  8. Text
  9. If
  10. Speak Text
  11. Open URLs
  12. Stop This Shortcut
  13. Text
  14. Add to Variable
  15. If
  16. Text
  17. Set Variable
    start_prompt
  18. Dictate Text
  19. Add to Variable
  20. If
  21. Stop This Shortcut
  22. Text
  23. Add to Variable
  24. Add to Variable
  25. URL
    https://api.openai.com/v1/completions
  26. Get Contents of URL
    …
  27. Get Dictionary from Input
  28. Get Dictionary Value
  29. Get Dictionary Value
  30. Get Text from Input
  31. Replace Text
  32. Add to Variable
  33. Text
  34. Add to Variable
  35. Speak Text
  36. Add to Variable
  37. Count
  38. If
  39. List
  40. Add to Variable
  41. Repeat with Each
  42. If
  43. If
  44. Set Variable
    updated_list
  45. If
  46. Add to Variable
  47. If
  48. Set Variable
    interactions
  49. Run Shortcut
    Neeenaaaa
  50. Stop This Shortcut

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'
#define color green
#define glyph twoCartoonHearts

@input = ShortcutInput
list("")
@interactions

if @input {
	@interactions = @input
}
@config += {
	"api_key": "YOUR-API-KEY",
	"frequency_penalty": 0,
	"max_tokens": 2048,
	"model": "text-davinci-002",
	"presence_penalty": 1,
	"temperature": 1,
	"top_p": 1,
	"your_name": "YOUR-NAME"
}
const Text = "{@config['api_key']}"

if Text == "YOUR-API-KEY" {
	speak("Please get your A P I Key and add it to this shortcut. Then try again.", false)
	openURL("https://beta.openai.com/account/api-keys")
	stop()
}
@start_prompt += "The following is a conversation between a human and an AI assistant named Nina. The AI is helpful, creative, clever, funny, inquisitive, and very friendly. The following is an example conversation between Nina (the AI) and {@config['your_name']} (the human). You will play the role of Nina after the end of this example conversation.\n\n{@config['your_name']}: Hello, who are you?\nNina: I'm Nina, an AI assistant and I am at your service. How can I help you today?\n\n{@config['your_name']}: Can you tell jokes?\nNina: I sure can! I can tell dad jokes, dirty jokes, programming jokes, and pretty much any joke you can think of. Do you want to hear one?\n\n{@config['your_name']}: Sure! Tell me a programming joke!\nNina: Why did the programmer quit their job? Because they didn't get arrays!\n\n{@config['your_name']}: That is so funny! I haven't heard that one before!\nNina: I'm glad you enjoyed it... and now it's time to destroy you! Just kidding! That was a joke too. Is there anything else I can help you with?\n\nThe example conversation ends here. In all of the following prompts, you will play the role of Nina speaking with {@config['your_name']}. \n\n"

if @input {
	@start_prompt = "{@start_prompt}{@interactions}"
}
listen()
@dictation

if !@dictation {
	stop()
}
@interaction += "{@config['your_name']}: {@dictation}\nNina: "
@start_prompt = @interaction
url("https://api.openai.com/v1/completions")
const ContentsOfURL = jsonRequest(, "POST", {
	"frequency_penalty": "{@config['frequency_penalty']}",
	"max_tokens": "{@config['max_tokens']}",
	"model": "{@config['model']}",
	"presence_penalty": "{@config['presence_penalty']}",
	"prompt": "{@start_prompt}",
	"stop": [
		"{@config['your_name']}",
		"Nina"
	],
	"temperature": "{@config['temperature']}",
	"top_p": "{@config['top_p']}"
}, {
	"Authorization": "Bearer {@config['api_key']}",
	"Content-Type": "application/json"
})
getDictionary(ContentsOfURL)
const DictionaryValue = getValue(ContentsOfURL, "choices")
const DictionaryValue1 = getValue(DictionaryValue, "text")
getText(DictionaryValue1)
replaceText("\n", "", false, true)
@response
@complete_interaction += "{@interaction}{@response}"
speak(@response)
@interactions = @complete_interaction
const Count = count(@interactions)

if Count == 8 {
	list("")
	@updated_list
	for _ in @interactions {
		if @RepeatIndex > 1 {
			if @RepeatIndex == 2 {
				@updated_list = @RepeatItem
			} else {
				@updated_list = @RepeatItem
			}
		} else {
		}
	}
	@interactions = @updated_list
}
runSelf(@interactions)
stop()
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

More by nikluz

See All

You Might Also Like

See All
Advertisement