Conditional syntax for reusable prompts

Hi everyone,
I’m using reusable prompts with Response API and would like to handle optional variables without hardcoding text in the code. In my case, I sometimes need to apply a specific style to the response text, but this parameter isn’t always provided — it depends on the user’s choice.

It would be great to have a conditional template syntax for variables in reusable prompts (for example, to include certain instructions only if a variable is defined). I couldn’t find any mentions of such functionality in the documentation.

Is there currently any way to achieve this?
And if not, I think adding conditional logic support would be a very useful feature for prompt templates. Perhaps OpenAI could consider implementing support for a lightweight template language like Handlebars or something similar, which would make prompt customization much more flexible.

I don’t think you can do that on the Openai platform right now, but Promptlayer and Prompthub are two platforms that do. I like promptlayer.

Thanks, I didn’t know about these platforms. I’ll take a look.
However, I’m mostly using the API and saving my prompts directly in the dashboard, where I can test and optimize them.
It would be great if we could have some built-in syntax for these kinds of conditional cases in the future, right out of the box.