Class DecisionQuestion

java.lang.Object
com.alibaba.dashscope.types.decision.DecisionQuestion

public final class DecisionQuestion extends Object
One question for the decision model (TypeSafe System One). Use choice(java.lang.String, java.util.Map<java.lang.String, java.lang.String>), noul(java.lang.String), score(java.lang.String, java.util.List<java.lang.String>) for typed questions, or raw(Map) to pass a wire-shaped question through untouched — the escape hatch that keeps future question fields usable before this SDK models them (raw questions skip client-side validation).

criteria shape follows type: choice takes a Map<optionName, description> (1–255 options; give the full set and add an other fallback); score takes a List of level descriptions ordered low to high (2–255 levels; 3–7 clearly distinguishable levels work best); noul takes an optional Map with "true" / "false" keys.

  • Field Details

    • TYPE_CHOICE

      public static final String TYPE_CHOICE
      Multiple choice; the answer carries the selected option name.
      See Also:
    • TYPE_NOUL

      public static final String TYPE_NOUL
      Yes/no judgement; the answer is P(yes), 0 = no and 1 = yes.
      See Also:
    • TYPE_SCORE

      public static final String TYPE_SCORE
      Ordinal scale; the answer is the probability-weighted level index.
      See Also:
    • MIN_CRITERIA_SIZE

      public static final int MIN_CRITERIA_SIZE
      Documented bounds on choice options / score levels.
      See Also:
    • MAX_CHOICE_OPTIONS

      public static final int MAX_CHOICE_OPTIONS
      See Also:
    • MIN_SCORE_LEVELS

      public static final int MIN_SCORE_LEVELS
      See Also:
    • MAX_SCORE_LEVELS

      public static final int MAX_SCORE_LEVELS
      See Also:
  • Method Details

    • choice

      public static DecisionQuestion choice(String instructions, Map<String,String> options)
      A pick-one-of-N question.
    • noul

      public static DecisionQuestion noul(String instructions)
      A yes/no judgement without explicit outcome descriptions.
    • noul

      public static DecisionQuestion noul(String instructions, String trueDesc, String falseDesc)
      A yes/no judgement; either description may be null to omit it.
    • score

      public static DecisionQuestion score(String instructions, List<String> levels)
      An ordinal-scale rating, levels ordered low to high.
    • raw

      public static DecisionQuestion raw(Map<String,Object> wire)
      A raw wire-shaped question ({type: ..., ...}), passed through unvalidated.
    • getType

      public String getType()
    • getInstructions

      public String getInstructions()
    • getCriteria

      public Object getCriteria()
    • isRaw

      public boolean isRaw()
      true when this question is a raw wire passthrough.
    • getRaw

      public Map<String,Object> getRaw()