ExTypesafe.Question.Choice (ExTypesafe v0.2.0)

Copy Markdown View Source

Picks one option from a set you define. Returns the chosen option and the full probability distribution across all options.

criteria is a map of option name to a description (or nil for no description). A description can be a string, map, or list. Choice questions accept at most 255 options.

%ExTypesafe.Question.Choice{
  instructions: "Which team should handle this?",
  criteria: %{
    billing: "Payments, invoicing, refunds",
    technical: "Bugs, outages, integrations",
    sales: "Pricing, upgrades, new accounts"
  }
}

Summary

Types

t()

@type t() :: %ExTypesafe.Question.Choice{
  criteria: %{required(atom() | String.t()) => ExTypesafe.Question.entry()},
  instructions: ExTypesafe.Question.instructions(),
  type: term()
}