Getting Text Input in Google Actions(recent version)

349 views Asked by At

How to get user input from actions SDK(recent version). In the previous version, we just use text intent like the example

app.intent('actions.intent.TEXT', async (conv, input) => {
   console.log('input', input)
})

I want to get user input as we do get in the previous version but the previous version is deprecating. How to get user input from the action builder?

In recent version they are providing intents, scenes, types etcc...

1

There are 1 answers

2
Nick Felker On

The custom NLU sample provides an example of sending the user's full text to your webhook to process.

It is accomplished through a simple user_utterance intent that accepts freeText and then calls a webhook.

Then your webhook can handle the intent's parameter:

app.handle('doAny', (conv) => {
    const any = conv.intent.params.any.original;
    conv.add(`You said ${any}.`);
});