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

Add support for required parameters #46

Closed
gdaniel opened this issue Jul 4, 2018 · 5 comments
Closed

Add support for required parameters #46

gdaniel opened this issue Jul 4, 2018 · 5 comments
Assignees
Labels
Core DialogFlow Enhancement New feature or request

Comments

@gdaniel
Copy link
Member

gdaniel commented Jul 4, 2018

We need to provide support for required parameters that are filled with additional questions by the bot.

@gdaniel gdaniel self-assigned this Jul 4, 2018
@gdaniel
Copy link
Member Author

gdaniel commented Jul 4, 2018

This feature is tricky to implement: we need to see how the DialogFlow Api answers incomplete queries and check if this is a feature coupled to the DialogFlow console.

If DialogFlow sends a custom response for requested parameters then we can probably adapt the framework to take it into account (or at least provide an "intent" connector to the designer). If not we need to reimplement it on the Xatkit side.

@gdaniel gdaniel added the Core label Jul 24, 2018
@gdaniel
Copy link
Member Author

gdaniel commented Jul 24, 2018

We need to handle this at the core level too

@gdaniel gdaniel added this to the Awaiting Integration milestone Aug 16, 2018
@gdaniel
Copy link
Member Author

gdaniel commented Aug 16, 2018

Required parameters are not part of the next release (current release: v1.0.0)

@gdaniel
Copy link
Member Author

gdaniel commented Mar 3, 2020

Required parameters are under discussion for the new language.

@gdaniel
Copy link
Member Author

gdaniel commented May 3, 2020

Required parameters are not a construct in the new language, but they can be easily simulated with transition conditions and/or if statement in state's body, e.g.
Transition condition version

MyState {
  Body { }
  Next {
    intent == MyIntent && intent.context.get("context").get("parameter") !== null --> NextState
  }
}

If statement version

State1 {
  Next {
    intent == MyIntent --> CheckState
  }
}
CheckState {
  Body {
    if(context.get("context").get("parameter") !== null) {
      // do something
    } else {
      // print an error message
    }
  }
  Next {
    // return to the previous state to wait for the intent again
    context.get("context").get("parameter") === null --> State1
    // continue the execution, the parameter is set
    context.get("context").get("parameter") !== null -> NextState
  }
}

@gdaniel gdaniel closed this as completed May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core DialogFlow Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant