Custom-UI form agent
You’ll build an agent fronted by a custom form. Users fill in a few fields, the agent produces a structured result, and it generates a downloadable document.
The plan
- Create the agent
- Build a custom form interface
- Return a structured result
- Generate a downloadable document
Step 1 — Create the agent
Create an agent in Agents. In System instructions, describe what to do with the form inputs and what the final document should contain.
Step 2 — Build the form
Open the Interfaces tab and use the form schema builder to define the fields users submit. This gives the agent clean, predictable input every time.
Step 3 — Return structured output
Enable Structured output so the result follows a fixed schema — useful if the output also feeds another system.
Step 4 — Produce a document
Turn on Artifacts in the Capabilities tab so the agent can generate a formatted document the user can open, edit, and download. For document layout that needs computation, also enable code execution. Test the full flow from the builder preview.