You can now easily leverage helpers in your prompt to format arguments. As a reminder prompts use handlebars under the hood. There are four helpers available
Helpers
limit
This restricts an argument to a maximum number of tokens. This is helpful if text might be super longer and you don't want to overload the prompt.
{{{limit args.test 100}}}
json
Formats a json argument as json:
{{{json args.json}}}
yaml
Formats a json argument as yaml. This a bit more concise then json:
{{{yaml args.json}}}
table
Formats a json argument that is an array of objects as a markdown table. This is usually the best choice for arrays of objects:
{{{table args.json }}}
If you want to chose the columns and their specific order you can pass in the c parameter. This accepts a string separated list of column names (object keys).
{{{table args.json c="id,animal"}}}
Learn More