A guide on how to write and format your prompts
When you build the form for your application, each form question has an "Identifier". This is a unique value given to the question so you can later reference it in your prompt. THe identifier can be any string or number of any length, but make sure is unique to the rest of the form questions.
Once you have established your form questions, you can then write your prompt. While you are writing your prompt, you will probably want to incorporate in the text the response that a user give to a specific question. To do this, you simply write {{identifier}}
. For example, a prompt to get blog articles for a product: "Return a list of blog post ideas for a product named {{product}}", where "product" is the identifier I gave to the form question.
With the above you can probably cover many use cases, but some prompts may require a bit more of logic depending on the type of question that you have on your form and the answer that you may get. A very possible case would be if you give the user a set of options to chooose from and you want your prompt to adapt. For example, the user can choose the tone of the response, so you can write your promot like this:
Return a list of blog post ideas for a product named {{product}}.
{% if tone == "happy" %}
The ideas should be with a happy and energetic tone.
{% elsif tone == "controversial" %}
Suggest ideas that are controversial.
{% elsif tone == "formal" %}
Ideas should have a formal tone for a corporate environment.
{% endif %}
Depending on which option the user choose the prompt will be created, so if the user chooose "happy" then the final prompt will be "Return a list of blog post ideas for a product named {{product}}. The ideas should be with a happy and energetic tone."
More advanced ways to control the final prompt https://shopify.github.io/liquid/tags/control-flow/