0

I'm trying to create a custom action through Google Assistant. I have custom user data which is defined by the user and I want the user to ask me something about this data, identifying which data they want to know about by supplying it's name.

ex: User says "Tell me about Fred" Assistant replies with "Fred is red"

[
  {
    "name":"Fred",
    "info":"Fred is red"
  }
]

The problem I'm having is how to add a Training phrases or re-prompting for the user to use when they supply a name which doesn't exist.

ex:

User says "Tell me about Greg" Assistant replies with "I couldn't find 'Greg'. Who would you like to know about?"

[
  {
    "name":"Fred",
    "info":"Fred is red"
  }
]

I've tried adding a Training response which only contains the 'name' parameter, but then if the user says "Tell me about Fred", the "name" parameter is set to "Tell me about Fred" instead of just "Fred", which means it ignores other Training responses I have setup.

Anyone out there who can be my Obi-wan Kenobi?

Edit: I've used Alexa for this same project and have sent to Alexa an elicitSlot directive. Can something similar be implemented?

doper1234
  • 17
  • 1
  • 5

1 Answers1

0

There is no real equivalent to an elicitSlot directive in this case (at least not the way I usually see it used), but it does provide several tools for accomplishing what you're trying to do.

The general approach is that, when sending your reply, you also set an Output Context with the reply. You can set as parameters for the Context any information that you want to retain (what value you're prompting for and possibly other state you've already collected).

Then you can have Intents that have this context set as an Input Context. The Intent will then only be matched if the Context is active. This Intent can match @sys.any, or whatever other Entity type might be appropriate in this case.

One advantage of this approach is that it allows for users to reply more conversationally, or pivot their reply away from the prompting question you've just asked. It allows for users to answer within the Context, or through other Intents that you've already setup for other purposes.

Prisoner
  • 49,922
  • 7
  • 53
  • 105