Escaneie com o iPhone para instalar
Pré-visualização
This is the "light" version of Nina.
You may only ask one question and get one response.
Original Description
This is a connection to the openAI API. By default I have it talking to text-davinci-002 (this model is the most fun and seems to have the least filtering) but you can change it by pressing the drop-down arrow on the API call and editing the model. Make sure you go to https://beta.openai.com/account/api-keys And get your API key and put it into the shortcut first. You can also modify the bot if you wish
Novidades
Versão 1.0
First release
O que ele faz
26 ações-
Text
-
Set VariableAPIKEY
-
Text
-
Set Variableprompt
-
If
-
Text
-
Set Variablewarning
-
Speak Text
-
Text
-
Set Variablekeylink
-
Open URLs
-
Stop This Shortcut
-
Dictate Text
-
Set Variablemessage
-
If
-
Text
-
Add to Variable
-
URLhttps://api.openai.com/v1/completions
-
Get Contents of URL…
-
Get Dictionary from Input
-
Get Dictionary Value
-
Get Dictionary Value
-
Set Variableresponse
-
Speak Text
-
If
-
Stop This Shortcut
Ver como código
Todas as ações deste atalho escritas em Cherri, uma linguagem de programação para o app Atalhos. Ótimo para aprender como ele funciona.
#include 'actions/web'
#include 'actions/text'
#define color green
#define glyph twoCartoonHearts
@APIKEY = "sk-xxxx"
@prompt = "The following is a conversation with an AI assistant named Nina. The AI is helpful, creative, clever, and very friendly. The following is an example conversation between Nina (the AI) and Nikki (the human). You will play the role of Nina after the end of the example conversation.\n\nPerson: Hello, who are you?\nNina: I'm Nina, an AI assistant. How can i help you?\n\nPerson: What is 2 + 2?\nNina: 2 + 2 is 4.\n\nPerson: Thank you so much!\nNina: No problem at all, that was an easy one.\n\n"
if @APIKEY == "API-KEY-HERE" {
@warning = "You need to update this shortcut with your A P I key to use the AI assistant. \n\nPlease go to beta dot open A I dot com slash account slash A P I dash keys to get your A P I Key.\n\nThen open the shortcuts app and edit this shortcut by replacing \\"A P I-KEY-HERE\\" with your A P I key"
speak(@warning, false)
@keylink = "https://beta.openai.com/account/api-keys"
openURL(@keylink)
stop()
}
listen("After Short Pause", "en-US")
@message
if @message {
@prompt += "Nikki : {@message}\nNina : "
url("https://api.openai.com/v1/completions")
const ContenuDeLURL = jsonRequest(, "POST", {
"frequency_penalty": 0,
"max_tokens": 2048,
"model": "text-davinci-002",
"presence_penalty": 1,
"prompt": "{@prompt}",
"temperature": 1,
"top_p": 1
}, {
"Authorization": "Bearer {@APIKEY}",
"Content-Type": "application/json"
})
const Dictionnaire = getDictionary(ContenuDeLURL)
const ValeurDuDictionnaire = getValue(Dictionnaire, "choices")
@response = ValeurDuDictionnaire['text']
speak(@response)
} else {
stop()
}
Abrir no Cherri Playground
Descompilado com cherri 2.3.0 (GPL-2.0). Pode precisar de pequenos ajustes antes de compilar.
Avaliações e comentários
Escrever uma avaliação–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ainda não há avaliações. Seja o primeiro a compartilhar o que você pensa!
Publicidade
Mais de nikluz
Você também pode gostar
Publicidade