Alexa提问的技巧

时间:2018-03-28 12:09:31

标签: alexa alexa-skill

我正在开发Alexa技能,我几乎没有问题。对于其中两个问题(Q1,Q2),Alexa正在回答正确的答案(Answer1,Answer2),但对于其他问题(Q3,Q4),它正在回答(Answer1,Answer2)。

这是我的代码:

'use strict';

var APP_ID = ' ';

var CLIMATE_OUTPUT = 'Bangalore has a tropical savanna climate with distinct wet and dry seasons.';

var BENGALURU_DETAILS_OUTPUT = 'Bangalore, officially known as Bengaluru, is the capital of the Indian state of Karnataka. ';

var POPULATION_OUTPUT = 'It has a population of over ten million';

var POLLUTION_OUTPUT = 'Bangalore generates about 3,000 tonnes of solid waste per day';

var skill = require('./Skill.js');

var Service = function() {

    skill.call(this, APP_ID);
};

Service.prototype = Object.create(skill.prototype);

var detailsResponseFunction = function(intent, session, response) {
    response.tell(BENGALURU_DETAILS_OUTPUT);
};

var populationResponseFunction = function(intent, session, response) {
    response.tell(POPULATION_OUTPUT);
};

var climateResponseFunction = function(intent, session, response) {
    response.tell(CLIMATE_OUTPUT);
};

var pollutionResponseFunction = function(intent, session, response) {
    response.tell(POLLUTION_OUTPUT);
};

Service.prototype.intentHandlers = {

    'bengaluruDetails': detailsResponseFunction,

    'population': populationResponseFunction,

    'climate': climateResponseFunction,

    'pollution': pollutionResponseFunction

};

exports.handler = function(event, context) {

    var service = new Service();

    service.execute(event, context);

};

1 个答案:

答案 0 :(得分:0)

提问的方式是错误的。对于任何自定义技能,我们必须提出诸如“问{调用名称} {问题}。

之类的问题
相关问题