• Rayhan Memon
  • Posts
  • #22 - A Prompt Crafting Playground (My Side-Side-Project)

#22 - A Prompt Crafting Playground (My Side-Side-Project)

Y’all know I’ve been working on an app with some friends. That side project has kept me hella busy this week.

But I still want to take a second to share with you my side-side project. I think you might like it.

My girlfriend’s leading a workshop on how to wire language models into an application. It sounds simple on the surface, but it can get complex.

The logic in your application expects structured output. If I’m rendering a list of bullet points for the user, then I need a JSON parsable array to be returned from the model. And I need all the elements to be strings.

You need to be doing a few things in your application:

  1. Craft a clear prompt that tells the model exactly what kind of parsable format you want its output to be in,

  2. Parse and validate the response before it’s used,

  3. And this is key — recursively prompt the model with error feedback in cases where it fails validation (with a reasonable limit set, of course).

Anyways, my girlfriend workshop is in a few days and she’s also swamped this week. So I decided to help her prepare by creating this playground where she can demonstrate these best practices to attendees.

Check it out!

Quick reminder - If you appreciate my writing, please reply to this email or “add to address book”. These positive signals help my emails land in your inbox.

If you don't want these emails, you can unsubscribe below. If you were sent this email and want more, you can subscribe here.

See you next week — Rayhan