Parametric Prompt bugs
swyxio opened this issue · 7 comments
- deleting parameters
- the repro steps are:
- create a prompt with 2 or more params
- fill out the param fields
- delete one of the params from the prompt
- see how the UI is now buggy - doesnt show the variations, or shows too many variations
- i think this means that there is some hidden state inside here, and we should create a pure function that parse from prompt to param list
- words with $ in them
- this is minor but we shouldnt pick up on
micro$oft
- maybe using this regex
/\B\$[a-zA-z]+/g
- this is minor but we shouldnt pick up on
and then minor UX - i think we still need to randomize the variation list - because its super easy to generate 100's of 1000's of variations and its boring to have them proceed one by one with almost the same set of params
Yeah I was aware of some of these, decided to release it anyway. A workaround is to cut/paste the entire prompt, or make a small change inside one of the parameter inputs.
Agree on all your points. FYI I'll be traveling over the next 2 weeks and I'll try to work on this on the plane or when I have some time, but it's going to be intermittent. In the meantime, any improvements you can make are much appreciated but of course not at all required.
As for the randomizing, I'll defer it for later. I'll start a discussion I'll use #12 to ask some questions around this because I'm interested to see an example of how you imagine the randomization to work.
The solution here may be Svelte derived stores.
The order of operations goes like this: prompt > extract vars > build custom vars collection > transform it to prompt strings by replacing occurrences.
So the initial store would be the prompt, with the rest of them chaining off from it as derived stores with logic for extracting, splitting, replacing, etc.
I refactored the prompt matrix logic on the plane (I'm traveling) and pushed it to this branch prompt-matrix-refactor. I am very tempted to just merge it to main, but give it a whirl if you get a chance. I'm super tired right now and don't want to make stupid mistakes.
am in back 2 back conferences so prob not gonna do it in the next few days either haha
No worries, I'm gonna yolo merge it and worry about it later if there are issues.
Closing this, as it should be fixed by v0.8.1+