User State APIΒΆ

Each utterance in a Dialog is generated either by a Human or by a Bot. To understand, which of two has generated the utterance, refer to the user.user_type field:

{"utterances": [{"user": {"user_type": "human"}}]}

A skill can update any fields in User (Human or Bot) objects. If a Skill updates a Human, the Human fields will be changed in this utterance accordingly. If a Skill updates a Bot, the Bot fields will be changed in the next (generated by the bot) utterance.

Each new dialog starts with a new Bot with all default fields. However, the Human object is updated permanently, and when a Human starts a new dialog, the object is retrieved from a database with all updated fields.

The history of all changes made by skills to users can be looked up at the list of possible responses in the hypotheses field of a human utterance:

{"utterances": [{"user": {"user_type": "human"}, "hypotheses": []}]}