Tutorial on how to create a prompt extension? #2899
-
I want to create an extension that will auto-BREAK my prompt. Too often, I use someone else's prompt or if it goes over 75, it will split your prompt and it won't understand what the part that got split means because. For example, if it splits anywhere between "white background"... say in between the words or even in the middle, the first 75 block will just see "white" while the second block will start with "background" and it won't have a clue what to do with either of those tokens. So I want to look at commas and periods and insert BREAK's at the proper locations to keep phrases between commas and periods intact. I saw examples how to get the prompt, but not sure how to pass it on to the "engine" without touching the prompt itself. OTOH, I could have a button that manually fixes it. Either way is fine, but I have no clue how to do either (ie. create the button). But I can do the parsing. Having a button where the stylesheet buttons are would be fine, but having it be automatic in the background would be best. I also need access to the code that can count the tokens. I guess the style extension is the best one to look at. I've looked at that and it's a good start, but is overcomplicated for what I want to do. It also doesn't explain how to get access to the token counter code. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This should rarely happens if the prompt contains adequate commas, thanks to this setting
|
Beta Was this translation helpful? Give feedback.
This should rarely happens if the prompt contains adequate commas, thanks to this setting