Built-in tools
builtin__flatten
Flattens a list of lists into one list, with no model call.
Behavior
[[a, b], [c]]becomes[a, b, c].depthis how many levels are spliced; the default is 1.- Elements that aren't lists are kept as they are.
When to use it
- After a
mapwhose items each return a list, such as one search per query, before deduping, sorting or ranking the results.
| Available to | Effect |
|---|---|
| Any agent or plan step | Read-only |
Input
depthinteger
Levels to flatten; default 1
The list, usually a template like {{E1.results}}
Output
- id: E1
tool_name: builtin__flatten
input:
items: "{{input.items}}"