Alexa 提问技巧
Alexa skill for asking questions
我正在开发 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);
};
提问的方式不对。对于任何自定义技能,我们都必须提出诸如 ---“询问 {invocation name} {question} 之类的问题。
我正在开发 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);
};
提问的方式不对。对于任何自定义技能,我们都必须提出诸如 ---“询问 {invocation name} {question} 之类的问题。