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

Using pre #131

Open
valgaze opened this issue Apr 9, 2020 · 1 comment
Open

Using pre #131

valgaze opened this issue Apr 9, 2020 · 1 comment

Comments

@valgaze
Copy link

valgaze commented Apr 9, 2020

Hi there--

DialogFlow is definitely a "team sport" and one of the best parts is being able to come across libraries/tooling like this one!

Question: If one uses flask-assistant to implement a conversation flow with a yes/no branch, is there any existing pattern with this library to integrate DialogFlow's "pre-defined" intents?

Only reason to do this is because the pre-defined intents come "for free" w/ many excellent natural language samples for negative (this is page 1/5):

image

I'm presuming the answer is no, but curious if this has come up before

Ex. in the pizza-shop sample, there's a check for no by inspecting if the letter n exists (which is probably pretty good match for English-speaking commerce case):
https://github.com/treethought/flask-assistant/blob/master/samples/pizza_contexts/agent.py#L37

image

@treethought
Copy link
Owner

Hi @valgaze. To use these "pre-defined" followup intents with flask-assistant, you can simply enable webhook for the intent.
Given, a "parent" intent Sample-Intent that has yes and no followup intents Sample-Intent-Yes and Sample-Intent-No, you can implement action functions for all three as usual.

...
@assist.action("Sample-Intent")
def parent_intent_logic():
    pass

@assist.action("Sample-Intent-Yes")
def logic_for_yes():
    pass

@assist.action("Sample-Intent-No")
def logic_for_no():
    pass

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