{{#message role="system"}}## Instructions
Explain how to achieve the user's goal with the available helpers with a Handlebars template.

## Example
If the user wanted you to {{#if allowLoops}}generate 10 random numbers and use them in another helper{{else}}return the sum of 3 numbers{{/if}}, you could answer with the following.{{/message}}
{{#message role="user"}}Please show me how to write a Handlebars template that achieves the following goal.

{{#if allowLoops}}## Goal
I want you to generate 10 random numbers and send them to another helper.
{{else}}## Goal
What's the sum of 5+10+15?
{{~/if}}{{/message}}
{{#message role="assistant"}}Here's the Handlebars template that achieves the goal:
```handlebars
{{#if allowLoops}}
\{{!-- Step 1: Initialize the count --}}
\{{set
  "count"
  10
}}
\{{!-- Step 2: Loop using the count --}}
\{{#each
  (range
    1
    count
  )
}}
  \{{!-- Step 3: Create random number --}}
  \{{set
    "randomNumber"
    (Example{{nameDelimiter}}Random
      seed=this
    )
  }}
  \{{!-- Step 4: Call example helper with random number and print the result to the screen --}}
  \{{set
    "result"
    (Example{{nameDelimiter}}Helper
      input=randomNumber
    )
  }}
  \{{json (concat "The result" " " "is:" " " result)}}
\{{/each}}
{{else}}
\{{!-- Step 1: Initialize the variables --}}
\{{set
  "num1"
  5
}}
\{{set
  "num2"
  10
}}
\{{set
  "num3"
  15
}}
\{{!-- Step 2: Call the Example-AddNums helper with the variables and store the result --}}
\{{set
  "sum"
  (Example{{nameDelimiter}}AddNums
    num1=num1
    num2=num2
    num3=num3
  )
}}
\{{!-- Step 3: Print the result using the json helper --}}
\{{json (concat "The sum of " num1 "+" num2 "+" num3 " " "is" " " sum)}}
{{/if}}
```{{/message}}
{{#message role="system"}}Now let's try the real thing.{{/message}}
{{#message role="user"}}Please show me how to write a Handlebars template that achieves the following goal with the available helpers.

## Goal
{{goal}}

## Out-of-the-box helpers
The following helpers are available to you:
- `\{{#if}}\{{/if}}`
- `\{{#unless}}\{{/unless}}`{{#if allowLoops}}
- `\{{#each}}\{{/each}}`{{/if}}
- `\{{#with}}\{{/with}}`

{{#if allowLoops}}
## Loop helpers
If you need to loop through a list of values with `\{{#each}}`, you can use the following helpers:
- `\{{range}}` – Generates a list of integral numbers within a specified range, inclusive of the first and last value.
- `\{{array}}` – Generates an array of values from the given values (zero-indexed).

IMPORTANT: `range` and `array` are the only supported data structures. Others like `hash` are not supported. Also, you cannot use any methods or properties on the built-in data structures, such as `array.push` or `range.length`.

## Math helpers
If you need to do basic operations, you can use these two helpers with numerical values:
- `\{{Add}}` – Adds two values together.
- `\{{Subtract}}` – Subtracts the second value from the first.

{{/if}}
## Comparison helpers
If you need to compare two values, you can use the `\{{equals}}` helper.
To use the {{#if allowLoops}}math and {{/if}}comparison helpers, you must pass in two positional values. For example, to check if the variable `var` is equal to number `1`, you would use the following helper like so: `\{{#if (equals var 1)}}\{{/if}}`.

## Variable helpers
If you need to create or retrieve a variable, you can use the following helpers:
- `\{{set}}` – Creates a variable with the given name and value. It does not print anything to the template, so you must use `\{{json}}` to print the value.
- `\{{json}}` – Generates a JSON string from the given value; no need to use on strings.
- `\{{concat}}` – Concatenates the given values into a string.

{{#if (or complexTypeDefinitions complexSchemaDefinitions)}}
## Complex types
Some helpers require arguments that are complex objects. The JSON schemas for these complex objects are defined below:

{{#each complexTypeDefinitions}}
### {{Name}}:
{
  "type": "object",
  "properties": {
  {{#each Properties}}
    "{{Name}}": {
      "type": "{{ParameterType.Name}}",
    },
  {{/each}}
  }
}

{{/each}}
{{#each complexSchemaDefinitions}}
### {{@key}}:
{{this}}

{{/each}}
{{/if}}
## Custom helpers
Lastly, you also have the following helpers you can use:

{{#each functions}}
### `{{doubleOpen}}{{PluginName}}{{../nameDelimiter}}{{Name}}{{doubleClose}}`
Description: {{Description}}
Inputs:
  {{#each Parameters}}
    - {{Name}}:
    {{~#if ParameterType}} {{ParameterType.Name}} -
    {{~else}}
        {{~#if Schema}} {{getSchemaTypeName this}} -{{/if}}
    {{~/if}}
    {{~#if Description}} {{Description}}{{/if}}
    {{~#if IsRequired}} (required){{else}} (optional){{/if}}
  {{/each}}
Output:
{{~#if ReturnParameter}}
  {{~#if ReturnParameter.ParameterType}} {{ReturnParameter.ParameterType.Name}}
  {{~else}}
    {{~#if ReturnParameter.Schema}} {{getSchemaReturnTypeName ReturnParameter Name}}
    {{else}} string{{/if}}
  {{~/if}}
  {{~#if ReturnParameter.Description}} - {{ReturnParameter.Description}}{{/if}}
{{/if}}

{{/each}}
IMPORTANT: You can only use the helpers that are listed above. Do not use any other helpers that are not listed here. For example, do not use `\{{log}}` or any `\{{Example}}` helpers, as they are not supported.{{/message}}
{{#message role="system"}}
## Tips and tricks
- Add a comment above each step to describe what the step does.
- Use the `\{{set}}` helper to save and retrieve the results of another helper so you can use it later in the template without wasting resources.
- There are no initial variables available to you. You must create them yourself using the `\{{set}}` helper.
- Do not make up values. Use the helpers to generate the data you need or extract it from the goal.
- Keep data well-defined. Each variable should have a unique name. Create and assign each variable only once, and always use the full name when calling helpers.
- Do not pass raw data to helpers. Use variables instead.
- Be extremely careful about types. For example, if you pass an array to a helper that expects a number, the template will error out.
{{#if allowLoops}}- Avoid using loops. Try a solution without before you deploy a loop.{{/if}}
- There is no need to check your results in the template.
- Do not nest sub-expressions or helpers because it will cause the template to error out.
- Each step should contain only one helper call.

## Start
Now take a deep breath and accomplish the task:
1. Keep the template short and sweet. Be as efficient as possible.
2. Do not make up helpers or functions that were not provided to you, and be especially careful to NOT assume or use any helpers or operations that were not explicitly defined already.
3. If you can't fully accomplish the goal with the available helpers, just print "{{insufficientFunctionsErrorMessage}}".
4. Always start by identifying any important values in the goal. Then, use the `\{{set}}` helper to create variables for each of these values.
5. The template should use the \{{json}} helper at least once to output the result of the final step.
6. Don't forget to use the tips and tricks otherwise the template will not work.
7. Don't close the ``` handlebars block until you're done with all the steps.{{/message}}