Build your own StorybookGPT #25119
Replies: 5 comments
-
I don't have ChatGPT Plus, but I quickly took a shot at altering the prompt a little and converting to Angular. I could probably get better results by altering the prompt or parameters a bit more, but here is my initial results on a prompt to "GPT-3.5 Turbo", "GPT-4", "CodeLlama 34B v2" and "CodeLlama 34B Instruct". I tried to do a mix of OpenAI api models and models that could be run locally on decent computers. I just used the OpenRouter.ai playground, so I couldn't adjust parameters, like the api supports. Prompt:
Results: GPT-3.5 Turbo (It made an assumption that
Results: GPT-4 (It made an assumption to use "@storybook/addon-actions", even though I told it how I handle outputs, so an adjustment to the prompt would be needed to clarify that it should not make those assumptions.)
Results: CodeLlama 34B v2 (It made a minor wrong assumption to change how the default is exported. The code is condensed, without retaining the formatting, but the code is good for a fairly small 34B model. The formatting could easily just be fixed by a code formatting tool.)
Results: CodeLlama 34B Instruct (While this gave a decent response, I had to regenerate 3 times to get a response with code.)
I use CoPilot a lot, instead of prompting a model myself, because it seems to recognize my pattern for writing stories fairly quickly. It usually suggests a decent auto-completion starting point for stories, based on a story name or comment. I haven't looked to see if it could be enhanced with something, like this. |
Beta Was this translation helpful? Give feedback.
-
I'm thinking we could add interaction tests to the GPT prompt and looks like GPT-4 would be best for testing it out. Anyone have any thoughts on adding interactive tests? |
Beta Was this translation helpful? Give feedback.
-
Ok, here's what I have so far adding interaction tests and other details. The prompt is:
Here are the results using GPT-4. The code is the Button component in Storybook's Mealdrop repo. That code is here: https://github.com/yannbf/mealdrop/blob/main/src/components/Button/Button.tsx
|
Beta Was this translation helpful? Give feedback.
-
or You just use this one that i made |
Beta Was this translation helpful? Give feedback.
-
The main issue I've been having with my own StorybookGPT following this approach [and making my own modifications] is that it's been unable to understand the CSF3 requirement. The first reply will almost always use CSF2, despite having provided source files to reference, too. Has anyone found a way to trick it into avoiding CSF2? |
Beta Was this translation helpful? Give feedback.
-
Hey there! There’s a new blog on the Storybook site that shows how you can build a GPT for generating stories automatically. If you’re interested in adapting the prompt for other non-React frameworks, please do so and share your results here!
Link to the blog 👉
Beta Was this translation helpful? Give feedback.
All reactions