Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting slot values from UserEventRequest #85

Closed
jashton-vintel opened this issue Feb 18, 2021 · 2 comments
Closed

Setting slot values from UserEventRequest #85

jashton-vintel opened this issue Feb 18, 2021 · 2 comments

Comments

@jashton-vintel
Copy link

Hey!

I'm trying to elicit slots manually from the user so that I can also present them with APL documents for each turn to allow them to type the information instead of speak it if they wish. I send an ElicitSlot request and display the APL document which works fine. When the user types a value and presses the button I'm using SendEvent which returns me a UserEvent request which contains the information which they have typed. However I'm a little unsure of how to set the slot value to that of the value the user has entered since I don't have a handle on the Slots dictionary in the UserEvent request.. I guess i could use the session attributes and save it for the next turn until i have all the info but this didn't quite feel right.

I guess i either need to let the ElicitSlot request that the value is coming from either speech or the text input or handle the UserEvent and populate the slot value manually but I'm not too sure how to do either of these.. any ideas?

Not sure if this is a Alexa.NET.APL or Alexa.NET question so sorry if it's not directed at the right place.

@stoiveyp
Copy link
Owner

Hi @jashton-vintel

As the UserEventRequest doesn't have slots, you'll have to handle this yourself. When you respond to the UserEventRequest - respond using ElicitSlot but provide the optional intent parameter.

This intent object sets the state of the intent you expect the conversation to carry on with - so you can set the intent name and any slot values you need and it'll carry on as expected from there.

Hope this helps 👍

@jashton-vintel
Copy link
Author

Works a treat, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants