Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Templates #10

Open
wwboynton opened this issue Oct 25, 2023 · 3 comments
Open

Feature Request: Templates #10

wwboynton opened this issue Oct 25, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@wwboynton
Copy link

Hi there! Thanks for creating this incredible plugin which has absolutely revolutionized my workflow.

The Text Generator plugin has a fairly robust template support, where users can create templates with sections that have their own individual prompts, lending structure and coherence to the generated results.

I think it would be incredible if there were connected or similar functionality in Chat Stream -- the ability to use a template and determine the context window by making canvas links to that template would be really game-changing.

@rpggio
Copy link
Owner

rpggio commented Oct 25, 2023

@wwboynton thanks for the comment, I'm glad to hear about the impact!
To make sure I understand, could you describe a particular scenario where this feature would be used?

Also, I haven't tested it lately, but Chat Stream should accept parent links from note documents as context. If you had a prompt you wanted to re-use, you could link it from a note doc in multiple threads. (Also, if the first ancestor starts with SYSTEM PROMPT, it applies that content as the system prompt)

@wwboynton
Copy link
Author

wwboynton commented Oct 26, 2023

@rpggio sure thing, I think I could've been a little more clear in any case.

So let's imagine a story-writing scenario. You want to first write a document detailing the world, the major cities, etc. Then you might want to use that document as a basis for a lot of other things: places like shops and restaurants. You might want to flesh out some of the people who can be found in those places. You might want to do some writing about political factions in the city, or something.

All of those things can benefit from being linked upstream to that first document defining the city. Some of those things benefit from being linked multiple layers deep: the barkeep might be linked to the bar, which is linked to that first document. The political faction writeup also benefits from being linked to that first document about the city, but probably doesn't benefit at all from being linked to the bar. That kind of hierarchal progression of context is something which Chat Stream already does beautifully.

Where Chat Stream falls short is the consistency. When I generate four characters, even with a very specific prompt with a format provided and the same ancestors, GPT-4 takes lots of liberties with the level of detail, the formatting, and the structure. It uses different markdown header levels and other formatting, it creates new sections for some generations but not for others, etc. If I want each new character I generate to have the same exact format and details, I go to Text Generator. It allows me to draw up a template with multiple smaller prompts inside which might look like this:

# Prompt: NPC Name, NPC Role/Job
Prompt: A one-sentence physical description of the NPC

## Personality
Prompt: A brief description of the NPC's personality, including manner of speech and level of energy.

**Ideal:** Prompt: one sentence, in quotation marks from the perspective of the NPC, which outlines some of their core ideals or values
**Bond:** Prompt: one sentence, in quotation marks from the perspective of the NPC, which describes one important relationship the NPC has, either with a person, a group, an organization, or an object
**Flaw:** Prompt: one sentence, in quotation marks from the perspective of the NPC, which outlines a critical and defining character flaw.

## Routine
Prompt: A brief description of where the NPC can be found at different times and what they might be doing there.

Text Generator allows the use of such templates which keep things extremely well-structured and produce really consistent, cohesive results. However, it's more limited in where it can draw context: Text Generator doesn't work on the canvas -- it grabs context exclusively from within the active document, using a variety of methods to select what parts of the document to use. In many cases, if I try to do all of this work inside one document, it becomes way too big to fit inside the context window, and extremely tedious to select the parts I want to use as context for any given generation task.

If I had the power of Chat Stream's context selection using the canvas, combined with the structure and section-by-section prompting of Text Generator, it would be really easy to create this kind of structured, consistent branching content while limiting the context window to just the important pieces.

Maybe this could be done by an integration between the two -- a hotkey when on the canvas which would prompt the selection of a Text Generator template, feed the ancestral context from the canvas to the template, and then generate the text into a new card. Or maybe you can think of a better way to do it independently. Either way, I just think these two plugins have two killer features which, right now, I have very few good ways to use at the same time.

@rpggio rpggio added the enhancement New feature or request label Dec 12, 2023
@rpggio
Copy link
Owner

rpggio commented Dec 13, 2023

@wwboynton It appears that the template you show might be a prompt template, used to guide GPT to provide consistent output. Is that correct?
I have looked over Text Generator, and is quite an extensive plugin. It's not obvious the best way to make Chat Stream note chains available to TG, but you might consider asking that question in the Text Generator community. Chat Stream is comparatively very simple to understand, so it will be more obvious to TG folks how the tools might be connected.

If TG added canvas connections as a supported context source, it sounds like you would have exactly what you need. Chat Stream would then be redundant for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants