AITools

update_fill

Last updated on

Merge, clear, or reset values in an existing form or checklist draft

Changes an existing draft. It merges a patch, then clears paths, then resets paths. Values you do not touch stay as they were, and the draft keeps its evaluation_context. The output has the same shape as fill.

Only forms and checklists are supported.

Input

Takes a source plus:

FieldTypeRequiredDescription
dataobjectYesThe current draft payload, usually data from the last fill or update_fill
patchobjectNoValues to merge, in the same shape as data
clearstring[]NoPaths to empty, such as fields.weight, annexes.<id>, or items.<id> for a checklist
resetstring[]NoPaths to set back to their declared default. A path with no default is emptied.
evaluation_contextobjectNoThe draft's evaluation_context

A path that the artifact does not declare fails the call.

Output

FieldTypeDescription
acceptedbooleanWhether the update was applied
completebooleanWhether the updated draft meets every requirement
artifact_kind"form" | "checklist"Artifact kind
dataobjectThe full updated draft payload
evaluation_contextobjectThe draft's fixed context
errorsToolError[]One entry per rejected value
errorToolErrorSummary error when the update failed

Direct usage

import { executeUpdateFill } from "@paradoc/ai-tools"

const updated = await executeUpdateFill({
  source: "registry",
  registry_url: "https://public.paradoc.dev",
  artifact_name: "pet-addendum",
  data: draft.data,
  evaluation_context: draft.evaluation_context,
  patch: {
    fields: { weight: 45, isVaccinated: true },
    parties: {
      landlord: { id: "landlord-0", name: "Acme Properties LLC", legalName: "Acme Properties LLC" },
    },
  },
})

Clear a value the user wants to take back:

const cleared = await executeUpdateFill({
  source: "registry",
  registry_url: "https://public.paradoc.dev",
  artifact_name: "pet-addendum",
  data: updated.data,
  evaluation_context: updated.evaluation_context,
  clear: ["fields.weight"],
})

Example response

{
  "accepted": true,
  "complete": true,
  "artifact_kind": "form",
  "data": {
    "fields": { "petName": "Buddy", "species": "dog", "weight": 45, "isVaccinated": true },
    "parties": {
      "tenant": { "id": "tenant-0", "name": "Jane Doe" },
      "landlord": { "id": "landlord-0", "name": "Acme Properties LLC", "legalName": "Acme Properties LLC" }
    }
  },
  "evaluation_context": {
    "asOf": { "date": "2026-09-22", "datetime": "2026-09-22T14:05:11.630Z" }
  }
}

On this page