Dive

Built-in tools

builtin__decide

Asks a decision model typed questions about one state, in one call.

Behavior

  • Each question is answered independently and in parallel against the same state, in one call.
  • Question types: likelihood (a probability), choice (one option) and score (a level on a scale).
  • A choice can hold up to 255 options. To rank a list against a question, use builtin__rank, which turns the list into the options.
  • The result maps each question name to its answer, such as {{E1.urgent.probability}}.
  • Needs a decision model role, decider by default.

When to use it

  • Put the data in state and keep the questions short.
LoadedKindEffect
AlwaysdecisionNot marked read-only

Input

stateanyrequired

The data to judge: text, an object, or a list, usually a template like {{E2.ticket}} or {{item}}.

questionsobjectrequired

Question name → question. Likelihood: {"type": "likelihood", "instructions": "Is it urgent?"}, optionally with "criteria": {"true": …, "false": …}. Choice: {"type": "choice", "instructions": "Which team?", "criteria": {"billing": "Payments", "technical": "Bugs"}}. Score: {"type": "score", "instructions": "How frustrated?", "criteria": ["Calm", "Frustrated", "Angry"]} with 2 to 10 levels.

questions.<name>.typeenum<string>required

Available options: likelihood, choice, score

Output

An object with one answer per question, keyed by the question's name in questions. A step that asks urgent and team returns {"urgent": {...}, "team": {...}}, and later steps read {{E1.urgent.probability}} or {{E1.team.choice}}.

<name>object

The answer to the question with this name. Which fields it has depends on the question's type.

<name>.typeenum<string>

The question's type.

Available options: likelihood, choice, score

Likelihood only. How likely the statement is true, from 0 to 1.

Choice only. The key of the chosen option in criteria.

Score only. The probability-weighted level, from 0 (the first entry in criteria) to one less than the number of levels.

Choice and score only. How sure the model is of the answer, from 0 to 1.

Choice and score only. Each option's probability, keyed by option for a choice ({"billing": 0.98, "technical": 0.02}) and by level index for a score ({"0": 0.0, "1": 0.01, "2": 0.99}).

Score only. Each level index mapped to its entry in criteria, such as {"0": "Calm", "1": "Annoyed", "2": "Angry"}.

- id: E1
  tool_name: builtin__decide
  input:
    state: "{{input.state}}"
    questions: "{{input.questions}}"