TEXT
Match
-(\w+)(?:$|\?)
in
Clipboard

Matches
SCRIPTING
If
Matches
does not have any value
SCRIPTING
Show alert
Informational Message
SCRIPTING
Otherwise
TEXT
Get
Group At Index
1
in
Matches

Text
SCRIPTING
End If

If Result
TEXT
{
"Ask": {
"prefix": "",
"guide": "What's your question?",
"format": "text"
},
"Blog Post": {
"prefix": "Write a blog post about ",
"guide": "What are you writing a blog post about?",
"format": "text"
},
"Essay": {
"prefix": "Write an essay about ",
"guide": "What are you writing an essay about?",
"format": "text"
},
"Job Description": {
"prefix": "Write a job description for this role ",
"guide": "Which role is the job description for?",
"format": "text"
},
"Ideas": {
"prefix": "Give me ideas about ",
"guide": "What do you need ideas for?",
"format": "text"
},
"Meeting Adenda": {
"prefix": "Write an agenda for a meeting about ",
"prompt": "What is the meeting about?",
"format": "text"
},
"Poem": {
"prefix": "Write a poem about ",
"guide": "What is the poem about?",
"format": "text"
},
"Press release": {
"prefix": "Write a press release about ",
"guide": "What is the press release about?",
"format": "text"
},
"Pros And Cons List": {
"prefix": "What are the pros and cons if I ",
"guide": "What are you considering doing?",
"format": "text"
},
"Recipe": {
"prefix": "Give me a recipe for ",
"guide": "What are you making?",
"format": "text"
},
"Recruitment Email": {
"prefix": "Write a recruitment email about ",
"guide": "What is the recruitment email about?",
"format": "text"
},
"Sales Email": {
"prefix": "Write a sales email about ",
"guide": "What is the sales email about?",
"format": "text"
},
"Script": {
"prefix": "Write a computer script ",
"guide": "What should the script do?",
"format": "script"
},
"Social Media Post": {
"prefix": "Write a social media post about ",
"guide": "What is the social media post about?",
"format": "text"
},
"Tweet": {
"prefix": "In less than 240 characters, write a social media post about ",
"guide": "What is the tweet about?",
"format": "text"
}
}

Text
SCRIPTING
Get dictionary from
Prompts Import

Dictionary
TEXT
{
"text-davinci-003": {
"limit (tokens)": 4000,
"price per token": 0.00002
},
"text-ada-001": {
"limit (tokens)": 2048,
"price per token": 0.0000004
}
}

Text
SCRIPTING
Get dictionary from
Models Import

Dictionary
TEXT
{
"-": "bullet point",
"*": "bullet point",
"•": "bullet point"
}

Text
SCRIPTING
Get dictionary from
Symbols Import

Dictionary
TEXT
abap
arduino
bash
basic
c
clojure
coffeescript
c++
c#
css
dart
diff
docker
elixir
elm
erlang
flow
fortran
f#
gherkin
glsl
go
graphql
groovy
haskell
html
java
javascript
json
julia
kotlin
latex
less
lisp
livescript
lua
makefile
markdown
markup
matlab
mermaid
nix
objective-c
ocaml
pascal
perl
php
plain text
powershell
prolog
protobuf
python
r
reason
ruby
rust
sass
scala
scheme
scss
shell
sql
swift
typescript
vb.net
verilog
vhdl
visual basic
webassembly
xml
yaml
java/c/c++/c#

Text
TEXT
Split
Text
by
New Lines

Split Text
SHORTCUTS
Run
Settings | GPT-3 x Notion

Shortcut Result
SCRIPTING
Get dictionary from
Shortcut Result

Dictionary
SCRIPTING
Get
Value
for
N API Key
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
N API Version
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
OA API Key
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
Include Request In Response?
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
model
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
temperature
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
echo
in
Settings

Dictionary Value
SCRIPTING
Get
Value
for
model
.limit (tokens)
in
Models

Dictionary Value
TEXT
true

Text
TEXT
false

Text
VARIABLES
Set variable
Repeat
to
True
VARIABLES
Set variable
Prompt
to
Input
SCRIPTING
Repeat
10 times

Repeat Results
SCRIPTING
If
Repeat
is
false
NOTHING
Nothing
SCRIPTING
Otherwise
SCRIPTING
Get
All Keys
in
All Prompts

Dictionary Value
FILES

Files
SCRIPTING
Choose from
Sorted Prompts
Prompt
Choose the type of request

Chosen Item
SCRIPTING
Get
Value
for
Chosen Prompt
.format
in
All Prompts

Dictionary Value
SCRIPTING
If
Format
is
script
SCRIPTING
Choose from
Code Languages

Chosen Item
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
Get
Value
for
Chosen Prompt
.guide
in
All Prompts

Dictionary Value
SCRIPTING
Ask
Guide
Default Answer
[{'class': 'magic', 'value': 'Request', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]

Provided Input
VARIABLES
Set variable
Request
to
Request
SCRIPTING
Get
Value
for
Chosen Prompt
.prefix
in
All Prompts

Dictionary Value
SCRIPTING
If
Format
is
script
TEXT
Request
Language
in
Prefix

Text
VARIABLES
Set variable
Prompt
to
Text
SCRIPTING
Otherwise
TEXT
Request
Prefix

Text
VARIABLES
Set variable
Prompt
to
Text
SCRIPTING
End If

If Result
SCRIPTING
Count
Characters
in
Prompt

Count
MATHS
Model Tokens Limit
-
Prompt Length
Options Under Construction

Calculation Result
TEXT
{
"model": "
Prompt
",
"prompt": "
model
",
"max_tokens":
Max Tokens
,
"temperature":
temperature
,
"stream": false
}

Text
NETWORK
Get contents of
https://api.openai.com/v1/completions
Options Under Construction

Contents of URL
SCRIPTING
Get
Value
for
error
in
Contents of URL

Dictionary Value
SCRIPTING
If
error
has any value
SCRIPTING
Get
Value
for
message
in
error

Dictionary Value
SCRIPTING
Show alert
Informational Message
SCRIPTING
Show alert
Informational Message
SCRIPTING
Otherwise
SCRIPTING
Get
Value
for
choices
in
Contents of URL

Dictionary Value
SCRIPTING
Get
First Item
from
Choices

Item from List
SCRIPTING
Get
Value
for
text
in
Item from List

Dictionary Value
SCRIPTING
Show alert
Informational Message
DOCUMENTS
Replace
\A\?\n\n|\A\n\n
with
World
in
Text

Updated Text
SCRIPTING
Show alert
Informational Message
SCRIPTING
Get
Value
for
usage.total_tokens
in
Contents of URL

Dictionary Value
SCRIPTING
Get
Value
for
model
.price per token
in
Models

Dictionary Value
MATHS
Price Per Token
×
Tokens Used
Options Under Construction

Calculation Result
TEXT
Cost
Cost: $
Formatted Text

Text
SCRIPTING
End If

If Result
SCRIPTING
SCRIPTING
Choose from Menu

Menu Result
SCRIPTING
Resubmit

Menu Result
SCRIPTING
Send To Notion

Menu Result
VARIABLES
Set variable
Repeat
to
False
SCRIPTING
If
Include request in response?
is
<value>
TEXT
{
"object": "block",
"type": "heading_2",
"heading_2": {
"rich_text": [
{
"type": "text",
"text": {
"content": "
Request
"
}
}
]
}
},

Text
VARIABLES
Set variable
Prompt JSON
to
Text
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
Get
Value
for
Chosen Prompt
.format
in
All Prompts

Dictionary Value
SCRIPTING
If
Format
is
script
DOCUMENTS
Replace
"
with
\"
in
Formatted Text

Updated Text
DOCUMENTS
Replace
\n
with
\\n
in
Text w. Escaped Speechmarks

Updated Text
TEXT
{
"object": "block",
"type": "code",
"code": {
"rich_text": [
{
"text": {
"content": "
Escaped Text
"
}
}
],
"language": "
Language
"
}
}

Text
VARIABLES
Set variable
Blocks JSON
to
Text
SCRIPTING
Otherwise
TEXT
Split
Text
by
New Lines

Split Text
SCRIPTING
Count
Items
in
Split Text

Count
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
TEXT
,

Text
VARIABLES
Set variable
Appended Comma
to
Comma
SCRIPTING
If
Repeat Index 2
is less than
3
COMMENT
First 2 lines are always empty so don’t process them
NOTHING
Nothing
SCRIPTING
Otherwise
TEXT
Match
^.
in
Repeat Item 2

Matches
SCRIPTING
If
1st Character
does not have any value