GithubHelp home page GithubHelp logo

actionssdk-say-number-nodejs's Introduction

Actions On Google: Actions SDK Sample

⚠️ Warning: Conversational Actions will be deprecated on June 13, 2023. For more information, see Conversational Actions Sunset.

⚠️ This code sample was built using the legacy Actions SDK. We now recommend using Actions Builder or the new Actions SDK to develop, test, and deploy Conversational Actions.

This sample demonstrates how to create an Action for the Google Assistant -- using Actions SDK in Node.js and deployed on Cloud Functions for Firebase.

Setup Instructions

Prerequisites

  1. Node.js and NPM
    • We recommend installing using NVM
  2. Install the Firebase Functions CLI
    • We recommend using version 6.5.0, npm install -g [email protected]
    • Run firebase login with your Google account
  3. Install the gactions CLI
    • You may need to grant execute permission, ‘chmod +x ./gactions’

Configuration

Actions Console

  1. From the Actions on Google Console, new project (this will become your Project ID) > Create project > under More options select Actions SDK > keep the Use Actions SDK to add Actions window open, will revisit in a later step.

Firebase Deployment

  1. On your local machine, in the functions directory, run npm install
  2. Run firebase deploy --project {PROJECT_ID}, replace {PROJECT_ID} to deploy the function
     Function URL (webhook): https://${REGION}-${PROJECT_ID}.cloudfunctions.net/webhook
    
  3. Update the action package, action.json, replacing the placeholder value YOUR_ENDPOINT_URL with the value for Function URL obtained from the previous step.
  4. From the top level directory in this sample, run gactions update --action_package action.json --project {PROJECT_ID} with your Project ID.
  5. Back in the Actions console, from the pop up window > select OK.
  6. From the top menu click Test to open the Actions on Google simulator then say or type Talk to my test app.

Running this Sample

  • You can test your Action on any Google Assistant-enabled device on which the Assistant is signed into the same account used to create this project. Just say or type, “OK Google, talk to my test app”.
  • You can also use the Actions on Google Console simulator to test most features and preview on-device behavior.

References & Issues

Make Contributions

Please read and follow the steps in the CONTRIBUTING.md.

License

See LICENSE.

Terms

Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.

actionssdk-say-number-nodejs's People

Contributors

atulep avatar canain avatar norulesjustfeels avatar silvolu avatar smishra2 avatar taycaldwell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actionssdk-say-number-nodejs's Issues

About engine field

Even though I installed latest version of Node.js it gives me the error below when I deploy functions.

Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "6"}.

I had to remove the part below from package.json file to make it work:

"engines": {
"node": ">=6.11.1"
}

Web Simulator

Hi,

Am a newbee. I followed all the instructions for install and deploying
As Gcloud deploy didn't work i used ngrok

D:\GooleHome\sdk-dir\gactions preview --action_package action.json --invocation_name "hello action" -- preview_mins 1234
Pushing action 'hello action' for testing...
'hello action' is now available for you until 2017-02-10 12:16PM IST (29 minutes from now)
Try 'gactions simulate', then 'talk to hello action', or use the Web Simulator at https://g.co/actionswebsim

When I tried both gactiosn simulate or Web Simulator , all the below triggers/actions am getting ' actions is not available'

  1. talk to hello action
    2.hello action
    3.At hello action

My question is does this sample app work with ngrok

README needs to be updated.

A step in the installation instructions on the README file is outdated.

In the step 3:

On the left navigation menu under BUILD, click on Actions. Click on Add Your First Action and choose your app's language(s).

When you click ADD YOUR FIRST ACTION, the console no longer displays the options to choose the language. Instead, it opens up a module that asks users to create action using Custom intent, Built-in intent, Templates, and Home automation.

Simulator will not call my app

I created an Action on https://console.actions.google.com/, associated it with a gcloud project, and gave it an Invocation Name.
Then these are the following steps I used.

  • Clone this exact repository
  • $ firebase init
    -- Follow Firebase instructions and added to a project in gcloud
  • $ firebase deploy --only functions
  • $ update action.json with URL for Firebase function
  • $ gactions update --action_package action.json --project <PROJECT_NAME>
  • $ gactions test --action_package action.json --project <PROJECT_NAME>
  • Go to simulator URL
  • Submit "Talk to <APP_INVOCATION_NAME>"
  • Get back error
Sorry, this action is not available for your app.
In the simulator, you are only able to invoke actions that you have added to your app. For more information on how to invoke your app, click here https://developers.google.com/actions/discovery/explicit

screen shot 2018-08-23 at 10 24 52

Now, I know the Action does get updated using the gaction CLI tool because I've added and removed a description and watched it update on the https://console.actions.google.com site.

It may very well be that I am doing something wrong but I've pored over documentation for a few days in order to try to get this working and I'm all out of ideas.

EDIT: Ok, I'm done editing this comment :)

error when deploying

Followed the directions listed here to deploy this action and received the following error when running gcloud app deploy:

Updating service [default]...failed.                                                                                                                       
ERROR: (gcloud.app.deploy) Error Response: [9] 
Application startup error:

> [email protected] start /app
> node app.js
module.js:328
    throw err;
    ^
Error: Cannot find module '/app/app.js'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the hello-action package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls hello-action
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log

It looks like it is looking for an app.js file that does not exists. Any help would be appreciated!

README Update

in the readme, the command gactions update is returning an error:

[ERROR] unknown command "update" for "gactions"

gactions push doesn't work the same way. I couldn't find another way to do it. Please help

Demo of Sample

Can a video or a gif of the sample be put in the Readme section?
It will help in understanding the actual output of the example and helps in deciding it's relevance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.