Comments (7)
Hi @terloon, thanks!
Is writing toIntentWithInputs
(+ toStateIntentWithInputs
, toStatelessIntentWithInputs) really that much of a timesaver compared to just adding the input as a parameter? Or are you dealing with a large amount of different inputs? Can you further elaborate why you're using
_.values(app.getInputs())instead of just
app.getInputs()`?
I would do it like this:
const handlers = {
'FirstIntent': function(name, age) {
app.toIntent('SecondIntent', name, age);
},
'SecondIntent': function(name, age) {
app.tell('Hi, your name is ' + name + ', and you are ' + age + ' years old.');
},
}
Am I missing something?
from jovo-framework.
So my use case was:
const handlers = {
'NEW_SESSION': function() {
// do some prep code required by all intents...
app.toIntent(app.getIntentName(), _values(app.getInputs());
},
'FirstIntent': function(one, two) {
},
'SecondIntent': function(one) {
}
}
But you're right, it doesn't really save much since this is done once and in NEW_SESSION would probably where this would likely be used.
Also, new to node.js (or at least its been a while since I did javascript), but I thought doing this:
app.toIntent(app.getIntentName(), app.getInputs());
would just make the first argument (or arguments[1]) be an object like:
{
"one": "value",
"two": "anotherValue"
}
Closing this issue. Thanks for the feedback.
from jovo-framework.
Hi @terloon, ah I get it, you want to use it inside NEW_SESSION
, this is why the number of inputs is variable.
So, you have tried just using app.toIntent(app.getIntentName())
without passing a parameter, and then accessing it, like so?
const handlers = {
'NEW_SESSION': function() {
// do some prep code required by all intents...
app.toIntent(app.getIntentName());
},
'FirstIntent': function(one, two) {
},
'SecondIntent': function(one) {
}
}
Because actually this should work (cc @aswetlow). We'll look into it
from jovo-framework.
I think I narrowed down the case where I had to do this. On the Alexa Test Simulator, if I don't pass in the input, when I perform an invocation of the voice app with a command, the input is lost.
So if my invocation is "hello world" with a skill like "start thing with number 1", if I say:
"ask hello world start thing with number 1", it would lose the slot input parameter.
from jovo-framework.
Hey yes, this is due to the 'NEW_SESSION' handler.
@aswetlow and I have recently run into the same problem and will think about a way to fix this in the upcoming version
from jovo-framework.
Gotcha. Right now I am getting around it by doing what I initially mentioned:
app.toIntent(app.getIntentName(), _.values(inputs));
from jovo-framework.
This got resolved some time ago
from jovo-framework.
Related Issues (20)
- Support Jovo v3 with alexa-verifier-middleware: 2.0.1 HOT 4
- Delete Reminder not working HOT 2
- CanFulfillIntentRequest failed with version 4.3.1 HOT 2
- Unwanted Interaction between UNHANDLED, routing and order of component inclusion in app.ts HOT 7
- Quick replies are set in the wrong directive on Alexa
- Jovo 4.5.0 Error in JovoDebugger dependency makes it unusable HOT 2
- Dependency Injection not working in AWS Lambda HOT 5
- Update jovo-db-mongodb v3 from mongodb:3.7.3 to mongodb:4.12.1 HOT 1
- Error using audioplayer events with UNHANDLED function in GlobalComponent HOT 2
- Error: Missing required argument #1 HOT 1
- Don't require package-lock.json HOT 1
- Jovo Debugger stopped showing $output HOT 1
- How to implement in a easy way a custom platform? HOT 1
- Cannot initialize Custom Platform. The custom platform is not seen as extended class of Plugin HOT 2
- [BUG] Initializing the TestSuite Class in the test file, create a wrong sourcemap to jest. (Show the wrong error line in the error log) HOT 3
- LexSlu Plugin: Expose LexRuntimeV2ClientConfig as libraryConfig and make it optional
- Deploying to Alexa fails with headers.find is not a function HOT 4
- Cannot convert undefined or null to object while building project files for Alexa HOT 1
- SpeechRecognizer doesn't support enabled: false
- Add type checking to resolve object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jovo-framework.