Hi there!
I am a super new user of Jovo and am trying out your new version 4. I can’t seem to use the Alexa slot type AMAZON.NUMBER in my seemingly simple entity.
Interaction model:
{
"invocation": "jovo test",
"version": "4.0",
"intents": {
"YesIntent": {
"phrases": [
"yes",
"yes please",
"sure"
]
},
"NoIntent": {
"phrases": [
"no",
"no thanks"
]
},
"SetBudgetIntent": {
"phrases" : [
"{budget}",
"set budget to {budget}",
"set to {budget}"
],
"entities": {
"budget" : {
"type": { "alexa": "AMAZON.NUMBER" }
}
}
},
"AMAZON.StopIntent" : {
"phrases" : []
}
}
}
The component: SetBudgetComponent:
import { BaseComponent, Component, Intents } from '@jovotech/framework';
import { YesNoOutput } from '../output/YesNoOutput';
import { BudgetValueOutput } from '../output/BudgetValueOutput';
@Component()
export class SetBudgetComponent extends BaseComponent {
START() {
return this.$send(YesNoOutput, { message: 'Welcome to your finance app! Do you want to set a budget ?' });
}
@Intents('YesIntent')
// method to save the budget here
whatBudget() {
return this.$send({ message: 'Ok, what do you want to set your budget to?' });
// const budget = this.$entities.budget.value;
// return this.$send({ message: 'Budget value is ' + budget })
}
@Intents('SetBudgetIntent')
setBudget() {
const budget = this.$entities.budget.value;
console.log(budget)
return this.$send({ message: 'Budget value is ' + budget })
}
@Intents('NoIntent')
dontSetBudget() {
this.$entities.budget = '200';
return this.$send({ message: `I will continue with the current budget: ` + this.$entities.budget });
}
// UNHANDLED() {
// return this.START();
// }
}