Examples menu

Examples / Fill in forms

An agent helps you fill out a form

The form fills in while the AI works: choices such as topic and urgency appear in a fraction of a second, and details such as name and email a few seconds later.

The UAG sends its answers back in batches, each as soon as it is ready. Choice fields (here topic, urgency and tone) are picked in milliseconds by a decision engine, an AI built to choose between options. Value fields (name, email, date) are written a few seconds later by a larger AI model. Agent Input fills each batch into the form as it arrives, so the choices are in place while the details are still being read.

There is nothing to set up for this: every form the UAG can fill (one with the uag tag) works this way. A field's uagEngine property can choose which AI answers it.

Try it: pick a sample and watch the What the UAG did panel. Under the agent/extract request, the choices and the values are listed in the order they arrived, with the time each took.

Turn it on

json
{
  "title": "Example: An agent helps you fill out a form",
  "name": "exampleAgentHelpsYouFill",
  "path": "example-agent-helps-you-fill",
  "type": "form",
  "display": "form",
  "tags": [
    "uag"
  ],
  "properties": {
    "description": "A general request: its topic, urgency and tone, and who sent it."
  },
  "components": [
    {
      "type": "textarea",
      "key": "description",
      "label": "Describe your request",
      "input": true,
      "placeholder": "Tell us what you need, in your own words.",
      "rows": 4,
      "validate": {
        "required": true
      },
      "properties": {
        "uag": "triage",
        "uagField": "input"
      }
    },
    {
      "type": "select",
      "key": "topic",
      "label": "Topic",
      "input": true,
      "dataSrc": "values",
      "data": {
        "values": [
          {
            "label": "Question",
            "value": "question"
          },
          {
            "label": "Problem",
            "value": "problem"
          },
          {
            "label": "Request",
            "value": "request"
          },
          {
            "label": "Feedback",
            "value": "feedback"
          }
        ]
      },
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "radio",
      "key": "urgency",
      "label": "Urgency",
      "input": true,
      "values": [
        {
          "label": "Low",
          "value": "low"
        },
        {
          "label": "Normal",
          "value": "normal"
        },
        {
          "label": "Urgent",
          "value": "urgent"
        }
      ],
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "radio",
      "key": "sentiment",
      "label": "Tone",
      "input": true,
      "values": [
        {
          "label": "Positive",
          "value": "positive"
        },
        {
          "label": "Neutral",
          "value": "neutral"
        },
        {
          "label": "Negative",
          "value": "negative"
        }
      ],
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "textfield",
      "key": "name",
      "label": "Name",
      "input": true,
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "email",
      "key": "email",
      "label": "Email",
      "input": true,
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "day",
      "key": "date",
      "label": "Date it started",
      "input": true,
      "properties": {
        "uag": "triage"
      }
    },
    {
      "type": "button",
      "key": "submit",
      "label": "Submit",
      "action": "submit",
      "input": true
    }
  ]
}

Try it

Samples:
Example: An agent helps you fill out a form

Read about it in the developer docs