ShareShortcuts

Nina Zero

This is the "light" version of Nina

nikluz
Создать форк «Nina Zero»

Создали что-то новое на основе этой команды? Поделитесь ей как форком: она станет вашей собственной командой, которой вы управляете, а обе страницы будут ссылаться друг на друга, чтобы nikluz получил(а) признание.

  1. 1Получите команду и измените её в приложении «Быстрые команды». Дайте ей собственное название.
  2. 2Поделись ею из приложения «Быстрые команды» и скопируй ссылку iCloud.
  3. 3Вернись сюда, вставь ссылку и опиши, что изменилось, например: «Добавлен шаг, который использует Apple Intelligence для персонализации текста».
Загрузки
35K
Сохранено
0
Действия
26
Категория
API
Версия
1.0
Язык
EN

Просмотр

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

Что нового

Версия 1.0

First release

История версий
1.0 27 янв 2023 г.

First release

Что делает

Действий: 26
  1. Text
  2. Set Variable
    APIKEY
  3. Text
  4. Set Variable
    prompt
  5. If
  6. Text
  7. Set Variable
    warning
  8. Speak Text
  9. Text
  10. Set Variable
    keylink
  11. Open URLs
  12. Stop This Shortcut
  13. Dictate Text
  14. Set Variable
    message
  15. If
  16. Text
  17. Add to Variable
  18. URL
    https://api.openai.com/v1/completions
  19. Get Contents of URL
    …
  20. Get Dictionary from Input
  21. Get Dictionary Value
  22. Get Dictionary Value
  23. Set Variable
    response
  24. Speak Text
  25. If
  26. Stop This Shortcut

Посмотреть как код
Бета

Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.

#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()
}
Открыть в Cherri Playground Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.

Оценки и отзывы

Написать отзыв
–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Пока нет отзывов. Поделись мнением первым!

Реклама

Ещё от nikluz

См. все

Вам также может понравиться

См. все
Реклама