Is there a stripped-down version of the Google Actions sample available?

I'm in search of an example of Actions on Google that demonstrates the usage of the primary Actions on Google Javascript client library located at:

https://github.com/actions-on-google/actions-on-google-nodejs

What I need from the sample is specific and includes the following:

  • Setting up my action.json file to handle Google Home requests (package file)
  • Retrieving the current user's email address or another unique, stable ID (possibly using OAuth functions)
  • Utilizing JSON package format to respond to requests with text and pre-recorded audio
  • Implementing Javascript code that demonstrates the necessary steps and messages to communicate effectively with Google during a session

You can find a variety of Actions on Google samples at this page:

https://github.com/actions-on-google

After reviewing numerous samples, it appears that many of them incorporate modules and services that are unnecessary for my project. Listed below are services that I specifically do not want to include as they will only complicate the development process:

- Firebase Cloud Functions (I plan to host my own backend server for managing conversations with Google)
- Api.ai (or any similar service). We already have our own natural language processing and conversation flow management code
- Console. Similar to the above reasons

Answer №1

Thank you to William DePalo for sharing this minimalistic sample on GitHub for those of us interested in hosting our own external Node.js server for handling fulfillment requests from Google Actions:

https://github.com/unclewill/parrot/blob/master/app.js

In this Google+ post, he explains the usage of the code:

He also provides some general guidance on using the code, including:

"I have uploaded this simple application on Github which serves as an assistant app, constructed with plain Node and Express in under 50 lines. It does not rely on Firebase, Google Cloud Functions, or API.AI, and its main function is to repeat what it hears. Although it was initially created for a brief presentation at a user group meeting that never took place, it should give you a good starting point.

The action package in the code is quite elaborate for a sample. It defines a custom intent (SCHEDULE_QUERY) that doesn't perform any operation in the sample, as I intended to discuss it at the meeting.

To state the obvious, pay attention to the textIntent() function where you should consider how to integrate your NLP. In my app, I have a hearAndReply() function in a separate module that processes the text heard by the recognizer and a session object, returning text and updating the session's state. By following this approach, you should be able to target another assistant with simpler yet more stable software."

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Sending users to either Page A or Page B depending on the response received from the API

Currently facing a dilemma. Imagine having a main hub page where you can navigate to either page A or page B. On this main page, there is a list of items. The goal is to trigger a GET API call upon clicking any item in the list. Based on a boolean field i ...

The usage of nextTick in Vue.js and its role in updating components

Although I am a beginner with vue.js and have a basic understanding of it, I came across a sample code utilizing nextTick() today. Trying to comprehend its purpose led me to explore the documentation, which ended up complicating things further and leavin ...

The datetimepicker is not functioning properly

I'm experiencing an issue with the datetimepicker where it doesn't display a calendar when I click the icon. Interestingly, the Chrome browser isn't showing any errors in the development console. <script src="Scripts/jquery-2.1.1.min.js ...

Populate the div with the URL parameter only when another span element is empty after a specified time interval using setTimeout

When displaying a person's name on a page, there are two different methods to consider. It can be extracted from the URL or retrieved from an email form in the CMS used. However, these two approaches sometimes conflict with each other. Currently, I h ...

Having difficulty changing the visibility of a div with Javascript

I've developed a piece of vanilla JavaScript to toggle the visibility of certain divs based on the field value within them. However, I'm encountering an issue where trying to unhide these divs using getElementById is resulting in null values. D ...

VueJS - Create a dynamic timer using setInterval function

I have a function that is initially triggered within the 'mounted' lifecycle hook, and then it continues to be called every 15 minutes. In my component, I am looking to showcase a countdown until the next setInterval in minutes and seconds. asyn ...

Error arises when using ODBC PDO alongside Ajax functionality

I've encountered a problem while working on a project at my job. I'm using PDO queries and ajax to generate dynamic elements, but I can't seem to fix a specific issue. The problem is that regardless of the option selected in two dynamically ...

Is it possible to filter JavaScript Array while ensuring that select options do not contain duplicate IDs?

I am utilizing two datatables with drag and drop functionality. Each row in the datatables contains IDs. When I drag a row from table 1 to table 2, the data is stored in an Array. I have an addArray function that pushes the IDs into the Array, filters out ...

The reply from the Servlet webpage is displayed on a fresh page

I am currently using Ajax and jQuery to handle the dynamic form submission process. While everything is functioning correctly, I am encountering an issue where the response from the Servlet is being displayed on a separate page. function initiateFormSubm ...

Javascript splice method mistakenly eliminating the incorrect elements

I have an array of objects like the one below: [{"name":"Rain"},{"name":"Storm"},{"name":"Forest"}] These objects are indexed as follows: [0, 1, 2]. I'm attempting to delete an item at a specific position using this code: $scope.selectedSound ...

Is there a way for me to update the button text and class to make it toggle-like

Is there a way to switch the button text and class when toggling? Currently, the default settings show a blue button with "Show" text, but upon click it should change to "Hide" with a white button background. <button class="btn exam-int-btn">Show< ...

What are the common practices for UI bindings in JavaScript and AJAX applications?

Background Information Currently, I am in the process of developing a traditional web application with most forms operating through AJAX. I am facing challenges in connecting the user interface to the model. As of now, I have to explicitly: Specify the ...

Define certain variables within a single document that will have an impact on others

Is there a way for me to avoid having users open a lengthy script just to make simple text changes? I am considering using variables in my index.html document to modify content in my javascript file. For instance: // index.html <script type="text/j ...

Vue3 TypeScript may potentially have an object that is 'undefined'

This piece of code is Vue3 with TypeScript-based. export interface TenantDto { uuid: string; name: string; } export const useTenantStore = defineStore('tenant', { state: () => ({ tenants: [], }), actions: { setMyTenants: (pa ...

"Mastering the art of debouncing in Angular using

I am facing an issue where, during a slow internet connection, users can press the save button multiple times resulting in saving multiple sets of data. This problem doesn't occur when working locally, but it does happen on our staging environment. E ...

html inserting line break using label

I am attempting to dynamically set text to a label using jQuery. However, I am having trouble getting the <br> or \n to create new lines. Instead, all the text displays on the same line and wraps around. If you want to see my code in action, ch ...

JavaScript implementation of the results sorting

I have 2 sql queries to calculate the turnover for each semester. Results from query 1: { "LRU": [ "RADOME", "RADOME", "ATSU", "MFC", "FWC", "Unspecified", "AZE", "ECP", "CMM", "ECP" ], "Client": [ 17346, ...

Using PHP as a data source, implement a feature in Google Maps that

I am currently working on incorporating an array of markers that are generated in PHP to a Google map. Below is the JavaScript code for my map: var map; var markers = []; var mapOptions = { //center: new google.maps.LatLng(locations[0].lat, locations[0 ...

Unable to get jQuery click and hide functions to function properly

Hello, I am currently working on a program where clicking a specific div should hide its own class and display another one. However, the code does not seem to be functioning correctly. Below is my current implementation: $("#one").click(function(){ v ...

What are the risks associated with allowing user-generated HTML or Javascript code on a website?

Is it really dangerous to allow users to edit HTML with Jinja2 templates and access some server-side variables that will be rendered later? I know Google uses Caja Compiler to sanitize and sandbox HTML served from Google Apps Script. Should I be concerned ...