Search code examples
dialogflow-eschatbot

How to get subjective answer from user


Is it possible to get a subjective answer from user? Here is sample conversation that I am trying to build,

  1. User: "I found a bug." => [triggers 'bug report' intent]
  2. Agent: "Can you explain the problem?"
  3. User: "App crashes everytime when I ask about xxx." => ['bug report follow-up' intent fails]

I wanted to catch the user answer, line #3. Even if I setup correct follow-up context, 'Default Fallback' or other intent came out and handle the user response. It seems there is no intent that can handle this kind of user query. I could not put 'Training phrase' because the answer can be any sentence. Maybe I can ask user to answer like "[The problem is] xxxxx", or "xxxxx [is not working], but it is not natural and limit the user answer. If there is a workaround to catch whole user query right after some intent, please share with me. :)


Solution

  • You should make 2 intents for this, lets say bug-1 and bug-2.

    In the bug-1, provide found a bug in training phrases and bug in output context and Can you explain the problem? in response.
    Now in bug-2, give bug as input context, change training phrases to template mode and give @sys.any in that and give some parameter name. Ex: @sys.any:bug.

    Now bug will contain the entire user query.

    enter image description here

    EDIT 1:
    By using @sys.any:bug, the the user query will be stored in the parameter named bug, which we can use in response by referencing $bug. See the pic below for clarification. enter image description here

    Hope it helps.