1. Handlebars Helpers
  2. To TOON String

Handlebars Helpers

To TOON String

Returns a TOON String for the value passed in

Uses

You can use this helper to convert an object, value, or array to a TOON string. TOON stands for Token-Oriented Object Notation (TOON) and is a human-readable data serialization format similar to YAML.
Learn more about TOON

TIP

Use TOON instead of JSON or YAML to optimize tokens when working with large data structures in your prompts and messages to LLMs.

Usage

Helper name : to_toon_string

Parameter Description
1 object / value / array to convert to TOON string

Examples

Example use in task:

loading...

Substituted definition

loading...

OUTPUT

        {
    "toonstring": "number: 1\nstring: string\nboolean: true\narray[3]: 1,2,3\nobj:\n  a: 1"
}

      

number: 1 string: string boolean: true array[3]: 1,2,3 obj: a: 1