-
Notifications
You must be signed in to change notification settings - Fork 101
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
How to retrieve the option in actions_intent_option #52
Comments
Hey @chaoranxie. I believe those helper functions are new in Actions V2 API. Unfortunately the library does not yet support v2. This means you need to uncheck the "Use Actions on Google Conversation API V2" option in DialogFlow's google assistant integration settings. I am working on updating the library to support V2, but in the meantime you can access the information from google assistant via flask-assistant's
The current implementation of list selectors pass the selected option as a "User Says" phrase to dialogflow. So if you select an option with the Sorry for the inconvenience, I'll try to have the V2 support ready soon |
Hi @treethought I am using v1 of the API right now. though that's not what's happening. any idea on how i can troubleshoot? here is the information i found.
|
so the help intent is the one building the list, and the find-event intent is the one supposed to handle the selected item. do you know if there is anything i need to do to make sure, the key/title of the item gets treated as "user say", i am not sure if i need to set something on help intent or find-event intent. |
analyzing the request parameter
while the second time i click the item on the list
|
Interesting. Thanks for this write up. |
I just tested the actions_demo from this repo and found that everything works as expected (including list option selection) when interacting with the agent via the However, I am running into the same issue when testing inside the This leads me to believe that somewhere in the 2 platforms' migration to V2 of actions on google, something was changed to where flask-assistant integrates properly with Dialogflow and Dialogflow integrates properly with Actions. But the communication from Actions back to DIalogflow and then to webhook is no longer aligned with the request/response format that was followed when originally implementing the integration inside flask-assistant. I'm sorry I don't have a solid answer right now. I will look into this tomorrow and get back to you. Thanks again for your info, it's really helpful. |
Yes, my previous comments show when i do add I confirmed that it works on the Don't be sorry, you are doing amazing work, and all the hard groundworks so the rest of us can just enjoy building assistant. This is not a deal breaker for me, just thought I would let you know. Feel free to post any information you find here, like blog article, stackoverflow questions if any here. i am still very new to the ecosystem, would love to learn more and maybe help out. |
Thanks for the kind words @chaoranxie. Though not always relevant to flask-assistant the DialogFlow forums are often a great resource. As you become more familiar with the space (or before) always feel free to contribute! In regards to the issue, I now have simple responses, cards, and lists working for actions v2 :). Not quite ready to merge into master, but will be soon. In the mean time you can checkout the |
While troubleshooting this issue with dialogflow V2, I have found that selecting an item automatically creates a context named Note that this applies only when interacting inside google assistant or the actions simulator. Within the dialogflow, the selected item's key is simply sent as a user phrase and should invoke the corresponding intent @assist.action('create-list')
def show_list():
speech = "Please select an option"
resp = ask(speech)
my_list = resp.build_list("List Title")
for i in my_items:
my_list.add_item(i['title'], i['key'])
# set a new context in case you have multiple intents with lists
context_manager.add('my-list-1-selection')
return my_list
@assist.context("my-list-1-selection")
@assist.action("Option-Select-Intent")
def handle_list_option_selection():
"""Special intent to handle option selection when using Google Assistant
Intent needs to have the actions_intent_OPTION event,
which will be invoked when an item is selected.
The action func parses the option key and then calls
the corresponding action function for the selection
"""
# this context was automatically created
c = context_manager.get("actions_intent_option")
key = c.get("OPTION")
return some_action_function(key)
# then to handle a different list's selection
# require the context set in that list's intent
# all list selections need to trigger the same intent
# via the action_intent_OPTION event
@assist.context("my-list-2-selection")
@assist.action("Option-Select")
def handle_other_list_option_selection():
c = context_manager.get("actions_intent_option")
key = c.get("OPTION")
return some_other_action_func(key) |
Hey @treethought, thanks for the update. I should start refactoring my code to decouple it from DialogFlow v1,v2 API so that I can move it to v2 without too much changes. |
from the doc https://developers.google.com/actions/assistant/helpers it looks like we should be able to access actions_intent_option value by
app.getContextArgument('actions_intent_option', 'OPTION').value
How do we do the same thing with flask-assistant? Thanks
The text was updated successfully, but these errors were encountered: