Normally an agent answers in prose. A custom response makes it answer in a shape you defined — a typed structure with named fields — so another system can consume the result instead of a human reading it.
When you'd use it #
Classification
Sort every inbound message into a case type and an urgency, and act on the field rather than the sentence.
Extraction
Pull a name, a date and a quantity out of a rambling message into three clean fields.
Routing
Have the agent decide which team a conversation belongs to, and return that decision as a value you can branch on.
Defining a schema #
-
Name the response
Something that says what it is for —triage_result,booking_details. -
Declare the fields and their types
Each field needs a name, a type and a description. The description is instruction to the model, so write it as one. -
Constrain wherever you can
A field that must be one of five values will be one of five values. A free-text field will be anything. -
Attach it to an agent
Set it as the agent's custom response in the builder.