for_each
A special system tool that allows for iteration over a list of items.
Fields
Name | Type | Description | Required |
---|---|---|---|
returns_key | string | If declared, this variable will be returned as an array of items from the loop. Note: We automatically flatten sub-arrays and highly recommend your return value be processed into one primative inside the loop before returning the value. | |
items | array | The list of items to iterate over. | |
each_item.item_name | string | The name of the variable to use for the current item in the loop. | |
each_item.tools | array | The list of tools to run for each item in the loop. Each iteration is run in parallel. |
Returns
Type | Description |
---|---|
prompt array | The list of items from the loop. |
Example
Last updated