Skip to content

Findout

Definition

<findout question_type="type" predicate="p" alts_predicate="p">

The element defines a question that should be answered, either by the user, or by some service connected to TDM capable of answering it.

Attribute Type Description
question_type string Optional. Defaults to wh_question, but can be one of goal, wh_question, alt_question, yn_question or kpq.
predicate string Optional. Required if question_type is wh_question or yn_question.
allow_answer_from_pcom string Optional. Defaults to false. If set to true, this allows TDM to recycle an old answer that the user has previously provided.
alts_predicate string Optional. If set, TDM builds alternatives for this findout from facts of the specified predicate and asks an alt/yn question accordingly.

Parents

Children

  • <alt>
  • <embedded_question/> when question_type="kpq".

JSON format

{
  "findout": {
    "question": { "wh": { "predicate": "filthy_animal" } },
    "alts_predicate": "available_animal"
  }
}

Behaviour

If alts_predicate is set, TDM looks for known facts with that predicate (from shared or private facts). If one alternative is found, the system asks a yes/no question; if multiple alternatives are found, it asks an alternative question. To store multiple facts for a predicate, define the predicate with multiple_instances="true" in the ontology.

Examples

A findout to ask the user what they want to do

  <findout type="goal"/>

A findout for a WH question, "which colour would you like?"

  <findout type="wh_question" predicate="colour"/>

A findout for a Yes/No question, "Would you like some fries with that?"

  <findout type="yn_question" predicate="side_order_fries"/>

A findout for a KPQ, "Do you know the destination?"

  <findout type="kpq">
    <embedded_question type="wh_question" predicate="destination"/>
  </findout>

A findout for a WH question, "What is your destination?", where the answer can be recycled from old answers

  <findout type="wh_question" predicate="destination" allow_answer_from_pcom="true"/>

A findout for an alt question, "Would you like to calculate the monthly payment or would you like to know the interest rate?"

<findout type="alt_question">
    <alt>
        <resolve type="wh_question" predicate="monthly_payment"/>
    </alt>
    <alt>
        <resolve type="wh_question" predicate="interest_rate"/>
    </alt>
</findout>

A findout for a yes/no question, "Should I connect you?"

<findout type="yn_question">
    <perform action="do_call_contact_from_history"/>
</findout>

A findout that uses fact-backed alternatives

  <assume_shared>
    <proposition predicate="available_animal" value="dog"/>
  </assume_shared>
  <assume_shared>
    <proposition predicate="available_animal" value="cow"/>
  </assume_shared>
  <findout type="wh_question" predicate="filthy_animal" alts_predicate="available_animal"/>