foreach
loop individually.
On this page, we will note some of the common conversions. Please keep in mind that we use LLM output as a string example but
the content applies to any string conversion.
String to JSON
You can use a Convert string to json step to convert a JSON string to a JSON object. In the image below, we pass in the LLM step answer as input into the convertor step and the output is the corresponding JSON object.
String to list
Use a (JavaScript Code step or Python) Code step to handle the conversion. All you need to do is to feed the string source value (e.g. LLM step answer) to your code step, apply the change (e.g.split(separator)
in JavaScript) and return the value.

String to Numbers or Booleans
Use a (JavaScript Code step or Python) Code step to handle the conversion. All you need to do is to feed the string version of the input (e.g. LLM step answer) to your code step. For numbers apply the parser (e.g.parseInt(string-value)
in JavaScript) and return
the results.
if ... else ...
) to return
the corresponding Boolean value (True or False).