【问题标题】:how can I handle built-in intents in alexa如何处理 Alexa 中的内置意图
【发布时间】:2017-10-31 18:35:13
【问题描述】:

诸如“下一个、上一个、更多..”之类的意图是我模型中所需的内置意图,我该如何在我的代码中准确地处理它们?我知道我应该委派,但我不知道该怎么做。请注意,这不是多轮对话,因此对话状态始终为空!

SpeechletResponse speechletResp = new SpeechletResponse();

DelegateDirective dd = new DelegateDirective();
List<Directive> directiveList = new ArrayList<>();
directiveList.add(dd);
speechletResp.setDirectives(directiveList);
speechletResp.setNullableShouldEndSession(null);

return speechletResp;

有时代码会返回错误,有时 Intent 会成功执行!!!

我不明白发生了什么,我的云手表上没有显示任何消息!

【问题讨论】:

    标签: alexa alexa-skills-kit alexa-skill


    【解决方案1】:

    它们的处理方式与其他意图类似。因此,我发布了一个 nodejs 示例,您也可以轻松地在 java 中使用它。您必须在内置 Intent 之前添加 AMAZON

    "SampleIntent": function() {
        console.log('ArtistSearchIntent HelpIntent');
        this.emit(":ask", "Know more about on google.com . Good 
        Bye!!", "Know more about on google.com . Good Bye!!");
    }
    "AMAZON.StopIntent": function() {
        console.log('ArtistSearchIntent StopIntent');
        this.emit(":tell", "Know more about on google.com. Good 
         Bye!!");
    },
    "AMAZON.CancelIntent": function() {
        console.log('ArtistSearchIntent CancelIntent');
        this.emit(":tell", "Know more about on google.com. Good 
        Bye!!");
    },
    "AMAZON.HelpIntent": function() {
        console.log('ArtistSearchIntent HelpIntent');
        this.emit(":ask", "Know more about on google.com . Good 
        Bye!!", "Know more about on google.com . Good Bye!!");
    }
    

    【讨论】:

    • 根据我在文档中的理解,Echo Show 的所有内置意图都可以由委托指令处理,除了:1. AMAZON.PreviousIntent 2. AMAZON.NextIntent 这是我的两个意图我特别难以处理。如何让 Alexa 在我的代码中返回上一个屏幕或在显示模板时显示更多项目?
    • @Acidburn73 我认为您必须使用状态管理从一个屏幕移动到另一个屏幕,并且状态保持不变。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多