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

Possible use of dialog to handle responses #1

Open
jt-nti opened this issue Sep 20, 2016 · 2 comments
Open

Possible use of dialog to handle responses #1

jt-nti opened this issue Sep 20, 2016 · 2 comments

Comments

@jt-nti
Copy link

jt-nti commented Sep 20, 2016

Just a slightly more detailed response to https://twitter.com/bobbyshaw/status/778280943635329024

There are a few options for integrating Conversation with external services, for example indicating a request to a service is required in the output and feeding the results back in via the context. That seems overly complex for the rugby bot though so if you did want to use the dialog facility in the Conversation service, I think I'd probably do something like this (using fixture as an example)...

  • Add a dialog node with a #next_fixture intent condition
  • Instead of a simple text output, use the advanced output editor for something like this...
{
  "output": {
    "text": "%s play %s on %s %s.",
    "request": "fixture"
  }
}
  • Detect that a fixture request is required and handle the external service the same way as now, and formatting the output text with the result of the external service

Results might need a slight tweak to handle the case when the game hasn't been played. Perhaps something like...

{
  "output": {
    "text": {
      "available": "The score between %s and %s was %d-%d.",
      "unavailable": "We haven't played that game yet"
    },
    "request": "result"
  }
}

Anyway, there's obviously no reason to use dialog but I think the above should work for any future bots where there's a simple interaction.

@bobbyshaw
Copy link
Owner

Oh, I understand now. It didn't click beforehand about writing custom entries in the JSON and consuming this instead via API.

Thanks for the write-up!

@jt-nti
Copy link
Author

jt-nti commented Sep 21, 2016

No problem. Nice bot, thanks for sharing it.

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