问题
Does anyone have any suggestions for obtaining a user’s email address through speech? Written is quite straight forward as email addresses follow a pattern to some degree, but using speech is quite difficult. Is it best to simply ask the user to read out the characters one by one?
回答1:
Dialogflow provides System entites for most common user inputs. You can use sys.email entity for your purpose and then use it in your fulfillment.
Getting the above email address in your webhook fulfillment :
app.intent('getEmail', (conv, params) => {
const userMail = params.email;
// remember to use the same variable name that you defined as
// Parameter name in your intent to access in params
});
Just make sure to manually select the email address in training phrases if dialogflow does not automatically detect it. Refer this for more assistance.
Hope that helps!
来源:https://stackoverflow.com/questions/53530274/dialogflow-email-address-from-speech