LESSON 03 / 08 6 MIN

Route with Choice

Choose one team from a set of named options.

Use Choice when your application needs one option from a set you define. Its criteria is an object: keys are the possible outcomes, and values describe when each outcome applies.

For a support router, define billing, technical, and sales. Specific descriptions make the boundaries between these teams clearer.

Read answers.team.choice to get the selected key. Choice also returns probabilities and confidence. Your application still decides what to do with those signals.

Your challenge

  1. Set questions.team.type to choice.
  2. Add billing, technical, and sales to criteria, each with a non-empty description.
  3. Keep instructions asking which team should handle the ticket.

request.json

Loading your draft…

Local checks · No API call

Your next decision starts here.

Edit the JSON, then check your work.
Hints are available whenever you need them.

Previous lessonLearn it. Try it. Make it work.Next lesson →