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.