Prompt Snippets
planned
B
Bastille Penguin
I would like to see a Prompt section for Snippets, these entries would have {...} functions expanded BEFORE being inserted into the main prompt. This would allow us to decouple our prompts and create re-usable building blocks.
Currently using {...} in a Snippet used in a prompt will render something like this:
{context.codex}
.In the proposed feature, if the Snippet was tagged as a prompt Snippet, the {context.codex} would have already been expanded.
Note: This would require a circular reference check to avoid infinite loops or a nesting level limit. Maybe a five-deep nesting level, which seems adequate for any use I can imagine.
Initially, I was thinking Codex entry, but snippets are a better fit, I think.
spaceemotion
planned
I am not sure if this should be a function for snippet, but reusable prompt "snippets" is definitely something i wanted to include in the future :)
B
Bastille Penguin
spaceemotion Totally fair. It just seemed the place most natural for me given the current system, but if you have a better location, I'm all for it. I am "merely" looking for a way to compose prompts from snippets that can hold function calls, which will get resolved. E.g. "Write in {novel.tense} and use {novel.language} spelling, grammar, and colloquialisms/slang." write it once, include it in multiple text replacement and beat expansion prompts.
It seemed that this request lined up neatly with the request for Snippet categorization.
B
Bastille Penguin
spaceemotion Of course, now it seems obvious. Simply nested prompts! {prompt.get("Other prompt")}. The root prompt determines the model used. Though, that opens an interesting focus of {prompt.run("Other Prompt","Model Name")}, where the result of the prompt against the given model would actually be embedded. That might make for some very fascinating effects and possibilities.
Whatever you decide, I'm having a ball playing in novelcrafter. Best money spent in ages!