Dive

Built-in tools

builtin__dedupe

Removes duplicates from a list, keeping the first of each, with no model call.

Behavior

  • by is the field compared, as a dot path such as url or meta.id. Without by, whole items are compared.
  • The first item of each key is kept, in the original order.
  • Items missing the field are all kept.
  • removed is how many items were dropped.
Available toEffect
Any agent or plan stepRead-only

Input

bystring

Dot path into each item to compare, e.g. url or meta.date

itemsany[]required

The list, usually a template like {{E1.results}}

Output

itemsany[]required
removedintegerrequired
- id: E1
  tool_name: builtin__dedupe
  input:
    items: "{{input.items}}"