Prompt engineering, the elusive craft of the snake taming the LLM.
Well, I've stared at the serpent long enough. I'm growing tired of playing this flute. And that's because there's a better way. In this post, I'm going to briefly talk about DSPy (Declarative Self-Prompting in Python).
DSPy isn't just a library. It's a philosophy that treats prompts as first-class, testable components rather than fragile strings glued together with hope and duct tape.
I'm going to show an example in Python, as the DSPy project is currently Python-focused and its syntax is pretty accessible, but the principles are not confined to Python (as you'll see in my repo below, which leverages the Ax project).