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

Feature/help messages #291

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

adaveinthelife
Copy link
Collaborator

This is my first iteration of the help interface action. Still working on adding more catch statements and possible fallbacks but this should be a good start. This is a proposed fix to issue #233.

To use the action, a person would say "help" or "assistance". The action walks them through the current app action (fsm state) that they're in while also giving them pointers on how to use the music player, etc. Also has information about collections. We might eventually want to add an artist search into this because I've found that a lot of users are not aware of what artists are contained in the collections.

@hyzhak
Copy link
Member

hyzhak commented Jul 19, 2018

Thanks!

I'd like how do you use target of help (player or collection) or fsm.getState(app).
And I'd recommend to implement it without switches just use both those keys and match to string structure in strings.js. Just add default/fallback answer in case when we don't have combination of app state and help target.

And btw we can't use app.conv.request.conversation.conversationToken because Alexa Skill doesn't have followups. And maybe we don't really need followup hierarchy here, because a user could ask: Help with music player. (or How does music player work?) without initial Help me phrase. Thus we would have help intent, with optional parameter and context app state.

@adaveinthelife adaveinthelife self-assigned this Jul 19, 2018
debug('INSIDE INTRO');
dialog.ask(app, {
speech: mustache.render(helpStrings.intro),
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you haven't break handler here, so you could have multiple dialog.ask is it on purpose?


if (!command) {
debug('Inside state switch...');
switch (state) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use object key-values matching instead of the switch.
The reason: with a key-value object - once we decide to add extra help we would need only add new help string in strings.js. For the switch design we would need to change handler and strings.js.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, I'd recommend to store strings with speech field, so we would be able to alter not only speech property of answer but also suggestions with shortcut options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//strings.js
{
  commands: {
    collection: {
      speech: 'There are two main collections to listen to. Our collection of 78s, which features a variety of genres including jazz, instrumental, and dance. Our other collection is of live concerts. These are live concert recordings that have been uploaded to the Archive. They include artists like the Grateful Dead and the Disco Biscuits.',
      suggestions: ['play jazz', 'play grateful dead'],
    },
    player: {
      speech: 'You can control the audio player by saying "pause" to stop the music and "play" to start it again. You can skip to the next song by saying "next song". You can hear the titles of songs in the player by saying "title on". You can turn off this feature by saying "title off".',
      suggestions: ['pause', 'next song'],
    },
  }
}
// ...
//handler.js
//...
dialog.ask(app, helpStrings[command] || helpString.default)
//...

Something like that

});
}
} // End of switch statement
fsm.transitionTo(app, constants.fsm.states.HELP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need help state?

// const _ = require('lodash');
const mustache = require('mustache');

const constants = require('../constants');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls put requirements in order of path

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

Successfully merging this pull request may close these issues.

2 participants