Vibe Coding: How to use LLM prompts to code effectively!
A demonstration of vibe coding, using plain text instructions to get an LLM to code, feeding back in the errors and/or additional context like API format required!
Here, I use it to generate a text-based game with background music based on emotions and images based on DALL-E 2. The LLM structured output format is provided by StrictJSON library!
Key takeaways:
1. LLMs is not that great with API syntax that are not within its memory. Use external context to give it the right format
2. LLMs can struggle with understanding code bases - use gitingest to help it understand a github better. Replace github with gitingest to get an LLM-friendly text of an entire github: Example Github: https://github.com/tanchongmin/agentjo
Example Gitingest: https://gitingest.com/tanchongmin/agentjo
3. Feeding back the errors can help the LLM correct itself. You are acting as a visual verifier, and you can also input your own "error message" to get the LLM to better understand the gameplay / visual aesthetics of the game
~~~
Refined pfoject can be found here: https://github.com/tanchongmin/agentjo/blob/main/contrib/Fun_AgentJo_Projects/Text-Based Adventure/Game.ipynb
StrictJSON: https://github.com/tanchongmin/strictjson
AgentJo: https://github.com/tanchongmin/agentjo
~~~
0:00 Introduction
1:13 Environment Setup + Initial Prompt
6:28 Initial Problem: Outdated API usage
17:44 Augmenting the prompt with proper API usage guide
22:24 gitingest of strictjson library
26:17 First working game?
29:31 Debugging with a simpler version
41:31 Using new chat to go back to gradio
45:32 Adding music
58:34 Using DALL-E 2 to generate images based on scenario
1:06:46 Final Game Prototype + Conclusion
~~~
AI and ML enthusiast. Likes to think about the essences behind breakthroughs of AI and explain it in a simple and relatable way. Also, I am an avid game creator.
Discord: https://discord.gg/bzp87AHJy5
LinkedIn: https://www.linkedin.com/in/chong-min-tan-94652288/
Online AI blog: https://delvingintotech.wordpress.com/
Twitter: https://twitter.com/johntanchongmin
Try out my games here: https://simmer.io/@chongmin