Skip to content

Instantly share code, notes, and snippets.

@Kotrotsos
Created May 2, 2023 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kotrotsos/9d796e1c76972c5979cfd26113fee95e to your computer and use it in GitHub Desktop.
Save Kotrotsos/9d796e1c76972c5979cfd26113fee95e to your computer and use it in GitHub Desktop.
{
"in": {
"topic": "life-lessons for a 20 year old"
},
"stacks": [
{
"comment":"Step 1. Generate an outline for an ebook with the topic {topic}",
"command": "gpt3",
"prompt": "give me an outline for a ebook about {topic}.",
"output": "$result_outline"
},
{
"comment":"This prompt will be used in the iteration, because it has an {item} variable, it will not be executed on it's own.",
"command": "gpt3-description",
"prompt": "give me an chapter for an book called {topic}, the chapter is: {item}",
"output": "$result_description"
},
{
"comment":"Step 2. Split the resulting generation from step 1, split by newline",
"command": "split",
"valueToSplit": "{result_outline}",
"separator": "\n",
"output": "$result_split"
},
{
"comment":"Loop over the splitted content from Step 2, put the value into {item}- separate using the separator property",
"command": "loop",
"list": "{result_split}",
"stackCommandToCall": "gpt3-description",
"separator": "\n\n\n",
"output": "$result_loop"
}
],
"out": [
{
"comment":"Output to screen",
"target": "screen",
"text": "{result_loop}"
},
{
"comment":"Output to a file too",
"target": "file",
"text": "{result_loop}",
"filename": "output35turbo2.txt"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment