form

form is a block command that creates a Form Complex Type instance. Each line in the block defines a field as name : descriptor.

Syntax

@formVar form param1 param2
    field1 : "description"
    field2 : "description" $param1
end

Example

@currentUser := "Michael"
@favCar form currentUser
    modelName : "modelName"
    color : "color"
    currentUser : $currentUser
end

Validated in tests/chat/formTest.mjs.

@cars form currentUser
    carName : "Car name of" $currentUser
    color : "the color of the car for" $currentUser
    year : "year of production of the car for" $currentUser
end
@workflowAgent new Workflow "Assistant"
workflowAgent.configure "Use " $cars " to find the favorite car for the user"

Validated in tests/pipelines/customTypes/workFlowAgent.mjs.

Step-by-Step Interaction

The first line declares the output variable and optional parameter names that can be interpolated inside field descriptors. Each non-empty body line must follow the fieldName : fieldDescriptor convention, and the parser converts those lines into a structured field map. After parsing completes, the runtime creates a Form instance and injects the parsed field metadata as initialization input. Higher-level orchestration types, especially Workflow, then consume this form object to ask targeted questions and to validate completion state.

Runtime Behavior Notes

If a line does not respect the required name : value structure, the runtime records an error and treats that definition as invalid. The command result is always a Form object rather than a plain string, because downstream components expect object-level access to field metadata. When initialization parameters change and the underlying instance supports reinitialization, the runtime can refresh the form object to keep schema content synchronized with current inputs.