Integrate actions sdk with aws lambda
up vote
0
down vote
favorite
I am trying to develop a google assistant app with actions sdk. I found lot of samples online which all are using google's firebase cloud functions to deploy.
From this link(https://actions-on-google.github.io/actions-on-google-nodejs/) I also found that it is possible to deploy the actions sdk functions into aws lambda.
But unfortunately I did not find any sample which is showing how to write and deploy actions sdk into aws lambda.
Can anybody help me to write an application which is similar to the one shown here(https://github.com/actions-on-google/actionssdk-say-number-nodejs) and deploy it into aws lambda?
I tried the following to do the same. But it did not worked.
- Created a folder and initialized it with "npm init".
- Added index.js file.
- Then ran the command "npm install actions-on-google". It appeared in the package.json file.
- Created a zip folder of the entire source inside that folder I created.
- Created a aws lambda function and uploaded the zip folder and set the "Handler" of the lambda function as "index.fulfillment".
- Created an api gateway and linked it to the lambda function and deployed it.
- Then took the url and editted the "actions.json" file and ran the gactions command.
- Then when I started testing the app in the actions console using the simulator I am getting the error "UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field"
Here is the code inside index.js file
'use strict';
const {actionssdk, SimpleResponse} = require('actions-on-google');
const app = actionssdk({debug: true});
app.intent('actions.intent.MAIN', (conv) => {
conv.ask("welcome");
});
app.intent('actions.intent.TEXT', async (conv, input) => {
conv.ask('You said ' + input);
});
exports.fulfillment = app
Here is the cloud watch logs from aws
2018-11-10T08:35:46.715Z 9dbb17f8-e4c3-11e8-bce3-730a5244a300
{
"errorMessage": "Cannot convert undefined or null to object",
"errorType": "TypeError",
"stackTrace": [
"Function.keys (<anonymous>)",
"Lambda.<anonymous> (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:36:36)",
"Generator.next (<anonymous>)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:22:71",
"new Promise (<anonymous>)",
"__awaiter (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:18:12)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:30:46",
"omni (/var/task/node_modules/actions-on-google/dist/assistant.js:44:53)"
]
}
aws-lambda actions-on-google
|
show 3 more comments
up vote
0
down vote
favorite
I am trying to develop a google assistant app with actions sdk. I found lot of samples online which all are using google's firebase cloud functions to deploy.
From this link(https://actions-on-google.github.io/actions-on-google-nodejs/) I also found that it is possible to deploy the actions sdk functions into aws lambda.
But unfortunately I did not find any sample which is showing how to write and deploy actions sdk into aws lambda.
Can anybody help me to write an application which is similar to the one shown here(https://github.com/actions-on-google/actionssdk-say-number-nodejs) and deploy it into aws lambda?
I tried the following to do the same. But it did not worked.
- Created a folder and initialized it with "npm init".
- Added index.js file.
- Then ran the command "npm install actions-on-google". It appeared in the package.json file.
- Created a zip folder of the entire source inside that folder I created.
- Created a aws lambda function and uploaded the zip folder and set the "Handler" of the lambda function as "index.fulfillment".
- Created an api gateway and linked it to the lambda function and deployed it.
- Then took the url and editted the "actions.json" file and ran the gactions command.
- Then when I started testing the app in the actions console using the simulator I am getting the error "UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field"
Here is the code inside index.js file
'use strict';
const {actionssdk, SimpleResponse} = require('actions-on-google');
const app = actionssdk({debug: true});
app.intent('actions.intent.MAIN', (conv) => {
conv.ask("welcome");
});
app.intent('actions.intent.TEXT', async (conv, input) => {
conv.ask('You said ' + input);
});
exports.fulfillment = app
Here is the cloud watch logs from aws
2018-11-10T08:35:46.715Z 9dbb17f8-e4c3-11e8-bce3-730a5244a300
{
"errorMessage": "Cannot convert undefined or null to object",
"errorType": "TypeError",
"stackTrace": [
"Function.keys (<anonymous>)",
"Lambda.<anonymous> (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:36:36)",
"Generator.next (<anonymous>)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:22:71",
"new Promise (<anonymous>)",
"__awaiter (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:18:12)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:30:46",
"omni (/var/task/node_modules/actions-on-google/dist/assistant.js:44:53)"
]
}
aws-lambda actions-on-google
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46
|
show 3 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to develop a google assistant app with actions sdk. I found lot of samples online which all are using google's firebase cloud functions to deploy.
From this link(https://actions-on-google.github.io/actions-on-google-nodejs/) I also found that it is possible to deploy the actions sdk functions into aws lambda.
But unfortunately I did not find any sample which is showing how to write and deploy actions sdk into aws lambda.
Can anybody help me to write an application which is similar to the one shown here(https://github.com/actions-on-google/actionssdk-say-number-nodejs) and deploy it into aws lambda?
I tried the following to do the same. But it did not worked.
- Created a folder and initialized it with "npm init".
- Added index.js file.
- Then ran the command "npm install actions-on-google". It appeared in the package.json file.
- Created a zip folder of the entire source inside that folder I created.
- Created a aws lambda function and uploaded the zip folder and set the "Handler" of the lambda function as "index.fulfillment".
- Created an api gateway and linked it to the lambda function and deployed it.
- Then took the url and editted the "actions.json" file and ran the gactions command.
- Then when I started testing the app in the actions console using the simulator I am getting the error "UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field"
Here is the code inside index.js file
'use strict';
const {actionssdk, SimpleResponse} = require('actions-on-google');
const app = actionssdk({debug: true});
app.intent('actions.intent.MAIN', (conv) => {
conv.ask("welcome");
});
app.intent('actions.intent.TEXT', async (conv, input) => {
conv.ask('You said ' + input);
});
exports.fulfillment = app
Here is the cloud watch logs from aws
2018-11-10T08:35:46.715Z 9dbb17f8-e4c3-11e8-bce3-730a5244a300
{
"errorMessage": "Cannot convert undefined or null to object",
"errorType": "TypeError",
"stackTrace": [
"Function.keys (<anonymous>)",
"Lambda.<anonymous> (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:36:36)",
"Generator.next (<anonymous>)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:22:71",
"new Promise (<anonymous>)",
"__awaiter (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:18:12)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:30:46",
"omni (/var/task/node_modules/actions-on-google/dist/assistant.js:44:53)"
]
}
aws-lambda actions-on-google
I am trying to develop a google assistant app with actions sdk. I found lot of samples online which all are using google's firebase cloud functions to deploy.
From this link(https://actions-on-google.github.io/actions-on-google-nodejs/) I also found that it is possible to deploy the actions sdk functions into aws lambda.
But unfortunately I did not find any sample which is showing how to write and deploy actions sdk into aws lambda.
Can anybody help me to write an application which is similar to the one shown here(https://github.com/actions-on-google/actionssdk-say-number-nodejs) and deploy it into aws lambda?
I tried the following to do the same. But it did not worked.
- Created a folder and initialized it with "npm init".
- Added index.js file.
- Then ran the command "npm install actions-on-google". It appeared in the package.json file.
- Created a zip folder of the entire source inside that folder I created.
- Created a aws lambda function and uploaded the zip folder and set the "Handler" of the lambda function as "index.fulfillment".
- Created an api gateway and linked it to the lambda function and deployed it.
- Then took the url and editted the "actions.json" file and ran the gactions command.
- Then when I started testing the app in the actions console using the simulator I am getting the error "UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field"
Here is the code inside index.js file
'use strict';
const {actionssdk, SimpleResponse} = require('actions-on-google');
const app = actionssdk({debug: true});
app.intent('actions.intent.MAIN', (conv) => {
conv.ask("welcome");
});
app.intent('actions.intent.TEXT', async (conv, input) => {
conv.ask('You said ' + input);
});
exports.fulfillment = app
Here is the cloud watch logs from aws
2018-11-10T08:35:46.715Z 9dbb17f8-e4c3-11e8-bce3-730a5244a300
{
"errorMessage": "Cannot convert undefined or null to object",
"errorType": "TypeError",
"stackTrace": [
"Function.keys (<anonymous>)",
"Lambda.<anonymous> (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:36:36)",
"Generator.next (<anonymous>)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:22:71",
"new Promise (<anonymous>)",
"__awaiter (/var/task/node_modules/actions-on-google/dist/framework/lambda.js:18:12)",
"/var/task/node_modules/actions-on-google/dist/framework/lambda.js:30:46",
"omni (/var/task/node_modules/actions-on-google/dist/assistant.js:44:53)"
]
}
aws-lambda actions-on-google
aws-lambda actions-on-google
edited Nov 10 at 20:50
asked Nov 5 at 8:16
Jerin Kurian
11328
11328
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46
|
show 3 more comments
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46
|
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
The code changes to host it on AWS are fairly straightforward. Instead of importing the firebase-functions library and using it, you just need to establish the lambda endpoint with the dialogflow app itself. So the code might look something like:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
// Setup intent handlers with app.intent() here
exports.factsAboutGoogle = app
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,app
is that handler. The name you export is the public name of the handler you choose.
– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The code changes to host it on AWS are fairly straightforward. Instead of importing the firebase-functions library and using it, you just need to establish the lambda endpoint with the dialogflow app itself. So the code might look something like:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
// Setup intent handlers with app.intent() here
exports.factsAboutGoogle = app
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,app
is that handler. The name you export is the public name of the handler you choose.
– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
add a comment |
up vote
1
down vote
The code changes to host it on AWS are fairly straightforward. Instead of importing the firebase-functions library and using it, you just need to establish the lambda endpoint with the dialogflow app itself. So the code might look something like:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
// Setup intent handlers with app.intent() here
exports.factsAboutGoogle = app
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,app
is that handler. The name you export is the public name of the handler you choose.
– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
add a comment |
up vote
1
down vote
up vote
1
down vote
The code changes to host it on AWS are fairly straightforward. Instead of importing the firebase-functions library and using it, you just need to establish the lambda endpoint with the dialogflow app itself. So the code might look something like:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
// Setup intent handlers with app.intent() here
exports.factsAboutGoogle = app
The code changes to host it on AWS are fairly straightforward. Instead of importing the firebase-functions library and using it, you just need to establish the lambda endpoint with the dialogflow app itself. So the code might look something like:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
// Setup intent handlers with app.intent() here
exports.factsAboutGoogle = app
answered Nov 5 at 15:19
Prisoner
29.5k12551
29.5k12551
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,app
is that handler. The name you export is the public name of the handler you choose.
– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
add a comment |
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,app
is that handler. The name you export is the public name of the handler you choose.
– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Thank you for the reply. How should I deploy it into aws. If it is a aws lambda function it is required to have a handler(for eg: index.handler) right?
– Jerin Kurian
Nov 5 at 20:52
Yes,
app
is that handler. The name you export is the public name of the handler you choose.– Prisoner
Nov 6 at 9:12
Yes,
app
is that handler. The name you export is the public name of the handler you choose.– Prisoner
Nov 6 at 9:12
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
Thanks again for the reply. I created a aws lambda function and uploaded the code as a zip file and in the handler I given "app". Then when I started testing in actions console I am getting this error. Can you please help? UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "error_message: Cannot find field."
– Jerin Kurian
Nov 6 at 14:04
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
If you're still having problems, please update the original question with the code you're using, exactly where you're getting the error, and any other info you may have.
– Prisoner
Nov 6 at 14:07
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
I updated the question with the code :)
– Jerin Kurian
Nov 6 at 14:46
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53150596%2fintegrate-actions-sdk-with-aws-lambda%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You mentioned you had problems with this code? Can you update the question to include the problems you're having, any error messages, logs, etc?
– Prisoner
Nov 6 at 15:42
Thank you for the reply :) Unfortunately I do not have any logs. But I updated the question with all the steps I did.
– Jerin Kurian
Nov 7 at 5:00
There are no cloudwatch logs generated by the lambda? You have debug set to true, so there should be something. If you can also update the question to include the contents of the "debug" tab in the simulator, that can help.
– Prisoner
Nov 7 at 10:44
Hi, I updated the question with logs from cloudwatch.
– Jerin Kurian
Nov 7 at 12:50
Hi, Now I was ale to fix the "--Bad handler app " issue. I changed the handler in lambda function to "index.fulfillment". Now I am getting another error "Cannot convert undefined or null to object". Anybody has any clue on this?
– Jerin Kurian
Nov 10 at 8:46