YAML
YAML is a human-readable data serialization format that is commonly used for configuration files and data exchange.
In the context of LLM, YAML is friendlier to the tokenizer algorithm and can generally be preferred to JSON to represent structured data.
defData
The defData
function renders an object to YAML in the prompt (and other formats if needed).
YAML
Similarly to the JSON
class in JavaScript, the YAML
class in LLM provides methods to parse and stringify YAML data.
parsers
The parsers also provides merciful parser for YAML.
Returns undefined
for invalid inputs.
Schemas
JSON schemas defined with defSchema can also be used to validate YAML data.