defineTextResponse
Purpose and behavior
Section titled “Purpose and behavior”Declare a text response with automatic tagged final-answer instructions. Returns the trimmed content of the last complete tag pair; missing tags fail with ResponseError. Invalid tags or repair counts fail with code configuration. Exact injected text and customization limits.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredTextResponseOptionsTag used by automatic final-answer instructions and allowed repair turns.options.tagRequiredstringTag name without angle brackets: a letter followed by letters, digits, _ or -. Another form fails with code configuration.options.repairsOptionalnumber | undefinedCorrection turns allowed after an invalid answer, default 0; must be a nonnegative integer. Above 0, the agent must be able to resume its conversation. Exact injected text and customization limits.

