npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jovotech/output-googleassistant

v4.0.0-beta.9

Published

--- title: 'Google Assistant Output' excerpt: 'Learn more about Jovo output templates for Google Assistant Output.' --- # Google Assistant Output

Readme


title: 'Google Assistant Output' excerpt: 'Learn more about Jovo output templates for Google Assistant Output.'

Google Assistant Output

Learn more about output templates for Google Assistant.

Introduction

Jovo offers the ability to create structured output that is then translated into native platform responses.

This structured output is called output template. Its root properties are generic output elements that work across platforms. Learn more about how generic output is translated into a Google Assistant response below.

{
  message: `Hello world! What's your name?`,
  reprompt: 'Could you tell me your name?',
  listen: true,
}

You can also add platform-specific output to an output template. Learn more about Google Assistant-specific output below.

{
  // ...
  platforms: {
    googleAssistant: {
      // ...
    }
  }
}

Generic Output Elements

Generic output elements are in the root of the output template and work across platforms. Learn more in the Jovo output template docs.

Below, you can find a list of generic output elements that work with Google Assistant:

message

The generic message element is what Google Assistant is saying (or displaying) to the user:

{
  message: 'Hello world!',
}

Under the hood, Jovo translates the message into a firstSimple response object (see the official Google Assistant docs):

{
  "prompt": {
    "firstSimple": {
      "speech": "<speak>Hello world!</speak>",
      "text": "Hello world!"
    }
  }
}

The resulting speech property gets automatically wrapped into SSML tags. For text, SSML is removed.

It's also possible to turn message into an object with a speech and a text property:

{
  message: {
    speech: 'Hello listener!',
    text: 'Hello reader!'
  },
}

This is then turned into the following response:

{
  "prompt": {
    "firstSimple": {
      "speech": "<speak>Hello listener!</speak>",
      "text": "Hello reader!"
    }
  }
}

reprompt

The generic reprompt element is used to ask again if the user does not respond to a prompt after a few seconds:

{
  message: `Hello world! What's your name?`,
  reprompt: 'Could you tell me your name?',
  listen: true,
}

Under the hood, Jovo translates the reprompt into NO_INPUT_1, NO_INPUT_2, and NO_INPUT_FINAL.

Note: For Google Assistant to wait for a user to answer a question, the listen property needs to be added.

listen

The listen element determines if Google Assistant should keep the microphone open and wait for a user's response.

By default (if you don't specify it otherwise in the template), listen is set to true. If you want to close a session after a response, you need to set it to false:

{
  message: `Goodbye!`,
  listen: false,
}

If listen is set to false, Jovo sets the expectUserResponse in the Google Assistant response to false.

The listen element can also be used to add dynamic entities, called type overrides in Google Assistant. Learn more in the $entities documentation.

quickReplies (Suggestions)

The generic quickReplies element translates into a concept called suggestions on Google Assistant. You can learn more in the official Google Assistant docs.

{
  // ...
  quickReplies: [ 'Yes', 'No' ]
}

Under the hood, Jovo translates quickReplies into the following:

{
  "suggestions": [
    {
      "title": "Yes"
    },
    {
      "title": "No"
    }
  ]
}

If you define your quickReplies using objects instead of strings, the text property will be used for the resulting title:

{
  quickReplies: [
    {
      text: 'oh yeah', // this is used for 'title'
      value: 'yes'
    },
    // ...
  ]
}

card

The generic card element can be used to display a basic card in Google Assistant. Learn more about basic cards in the official Google Assistant docs.

{
  // ...
  card: {
    title: 'Hello world!',
    subtitle: 'Some subtitle',
    content: 'Welcome to this new app built with Jovo.',
    imageUrl: 'https://...'
  },
}

Under the hood, this gets translated into the following object as part of the response to Google Assistant:

{
  "card": {
    "title": "Hello world!",
    "subtitle": "Some subtitle",
    "text": "Welcome to this new app built with Jovo.", // Taken from 'content'
    "image": {
      "alt": "Hello world!", // Taken from 'title'
      "url": "https://...",
    }
  }
}

carousel (Collection)

A generic carousel element is a horizontally scrollable set of card items. In Google Assistant, this is called a collection. Learn more in the official Google Assistant docs.

{
  // ...
  carousel: {
    title: 'Select an element',
    selection: {
      intent: 'SelectElementIntent',
      entityType: 'ElementType',
    },
    items: [
      {
        title: 'Element A',
        content: 'To my right, you will see element 2.'
        selection: {
          entities: {
            element: {
              value: 'a'
            }
          }
        }
      },
      {
        title: 'Element B',
        content: 'Hi there!',
        selection: {
          entities: {
            element: {
              value: 'b'
            }
          }
        }
      }
    ],
  },
}

It includes the following properties:

  • selection (required): This is used to map a selection of an item to both an intent and an entityType. The type is needed to create a type override (see official Google documentation).
  • items (required): An array of elements to be displayed. They also need to include a selection property with an entities map.
  • title (optional): A string that gets displayed at the top.

Google Assistant Output Elements

It is possible to add platform-specific output elements to an output template. Learn more in the Jovo output template documentation.

For Google Assistant, you can add output elements inside an googleAssistant object:

{
  // ...
  platforms: {
    googleAssistant: {
      // ...
    }
  }
}

nativeResponse

The nativeResponse property allows you to add native elements exactly how they would be added to the Google Assistant JSON response.

{
  // ...
  platforms: {
    googleAssistant: {
      nativeResponse: {
        // ...
      }
    }
  }
}

For example, you can add scene information (see the official Google docs) like this:

{
  // ...
  platforms: {
    googleAssistant: {
      nativeResponse: {
        scene: {
          name: 'SceneName',
          slots: {},
          next: {
            name: 'HiddenScene',
          }
        }
      }
    }
  }
}

You can find examples for the Google Assistant response format in the official Google documentation.