ai/filter

Built-in filter adapter for records of any type: its manifest, needs, provides, config keys, cost, and an example step

What you'll learn

You're about to put ai/filter in a step and want its keys, fields, credentials, and cost before plan tells you.

  • what the adapter needs and provides
  • every with: key it accepts
  • what it costs and which credential it demands

A built-in filter adapter for records of any type: it needs the step's uses: fields and declares no fields of its own. It publishes no per-record estimate, so plan prints ?, and it runs without a key, though ANTHROPIC_API_KEY and ANTHROPIC_WORKSPACE_ID are optional.

Manifest

KeyValue
idai/filter
version1
rolefilter
entity typeany type
credentialsANTHROPIC_API_KEY (optional), ANTHROPIC_WORKSPACE_ID (optional)
cost estimate per recordnot published

Needs

The fields the step's uses: line names, and nothing else.

Provides

A verdict per record. Fields declared in the step's provides: land beside it.

Config keys

The keys with: accepts. Plan rejects any other key.

KeyTypeRequiredWhat it sets
batch_sizeinteger
deferredbooleanADR-038: submit the batch to the engine's batch surface (the Message Batches API, half price) and end the run in flight; the next gtme run of the pipeline collects. Valid only on the pipeline's last step.
fencebooleanADR-035: wrap externally fetched fields in a delimiter labelled as subject-supplied data (default true); false opts out
fetchedarray of stringThe batch's externally fetched fields (ADR-035). Injected by the runner from provenance — never authored inside with:.
fieldsarray of stringRestrict what the model sees to these fields (default: everything known)
max_tokensinteger
modelstring
ofstringThe referent (ADR-048): the field whose value this step is about, presented to the model as the subject. Injected by the runner from the step-level of: key — never authored inside with:.
providesobjectThe step's derived provides schema (ADR-033). Injected by the runner from the step-level provides: key — never authored inside with:.
templatestringyesThe operator's text (ADR-057): a template rendered once per step over config.* — the shared block the records follow (SPEC §10.3). The runner loads {file:} and renders before OPEN; the adapter receives text.

Example

From See it run:

  - id: fit
    use: ai/filter
    uses: [title, company_name]
    with:
      template: >
        Keep only people who plausibly own outbound tooling decisions.

Used in

  • The full-funnel-with-uses example in gtme help --agent