ai/compose

Built-in compose 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/compose 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 compose adapter for records of any type: it needs the step's uses: fields and provides 2 fields. 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/compose
version1
rolecompose
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

{
  "additionalProperties": false,
  "properties": {
    "first_line": {
      "type": "string"
    },
    "ps_line": {
      "type": "string"
    }
  },
  "type": "object"
}

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: lines
    use: ai/compose
    when: fit.passed
    uses: [full_name, title, company_name]
    with:
      template: >
        Write first_line and ps_line for a short, honest intro email.

Used in

  • The full-funnel-with-uses example in gtme help --agent
  • The human-review-then-cron example in gtme help --agent
  • The csv-sourced-compose-with-uses example in gtme help --agent
  • The persona-file-and-text-compose example in gtme help --agent