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
First release
What it does
50 actions-
Add to Variable
-
List
-
Add to Variable
-
If
-
Set Variableinteractions
-
Dictionary
-
Add to Variable
-
Text
-
If
-
Speak Text
-
Open URLs
-
Stop This Shortcut
-
Text
-
Add to Variable
-
If
-
Text
-
Set Variablestart_prompt
-
Dictate Text
-
Add to Variable
-
If
-
Stop This Shortcut
-
Text
-
Add to Variable
-
Add to Variable
-
URLhttps://api.openai.com/v1/completions
-
Get Contents of URL…
-
Get Dictionary from Input
-
Get Dictionary Value
-
Get Dictionary Value
-
Get Text from Input
-
Replace Text
-
Add to Variable
-
Text
-
Add to Variable
-
Speak Text
-
Add to Variable
-
Count
-
If
-
List
-
Add to Variable
-
Repeat with Each
-
If
-
If
-
Set Variableupdated_list
-
If
-
Add to Variable
-
If
-
Set Variableinteractions
-
Run ShortcutNeeenaaaa
-
Stop This Shortcut
View as code
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()
Ratings & Reviews
Write a ReviewNo reviews yet. Be the first to share what you think!