Google Assistant (Dialogflow)

Integration published by Jovo | 9,689 downloads

Build apps for Google's Assistant platform using Dialogflow

Response

Introduction

The response is the data that you send to the platform after processing the request. It consists of information like:

  • output, e.g. speech, audio, etc.
  • permission requests,
  • or session data

Here's an example response:

The main component is the output. Besides the platform independent output, Google Assistant provides multiple other types of output. You can find out more about that in Interfaces section of the documentation.

$response Object

The $response object supports a handful of cross-platform helper methods to get/set its values. You can find them in the general response docs.

Besides that, Google Assistant supports the following getter methods:

Name Description Return Value
getBasicCard() Returns the response's basic card object. basic card object or undefined
getDisplayText() Returns the response's display text. string or undefined
getMediaResponse() Returns the media response object object or undefined
getSuggestionsChips() Returns the response's suggestion chips array. array or undefined
hasDisplayText() Returns true if the response contains a display text. If you parse a string, the method will only return true if the string and the display text value are equal. boolean
hasImageCard(title?: string, content?: string, imageUrl?: string) Returns true if the response contains an image card. If you parse any of the cards properties, the method will only return true if they are equal to the ones in the response. boolean
hasSimpleCard(title?: string, content?: string) Returns true if the response contains a simple card. If you parse any of the cards properties, the method will only return true if they are equal to the ones in the response. boolean
hasSuggestionChips(chips?: string[]) Returns true if the response contains suggestion chips. If you parse an array of strings, the method will only return true if the suggestion chip's title are equal to the parsed array's values (same order) boolean

Google Assistant Changelog

Current version might be higher than the latest changes displayed below because of updates of dependencies.

2021-07-07 [3.5.4]
  • #948 ✨ Add enableFullScreen and continueTtsDuringTouch (@aswetlow)

2021-02-22 [3.5]

  • #901 Move setResponse from response to after.response middleware (@aswetlow)
2020-11-20 [3.2.3]
2020-11-05 [3.2.1]
  • Fix Transaction API v2/v3 incomptibility

🐛 Bug Fix

  • #716 Corrected logic for retrieving project-ids in staged environments (@m-ripper)

Committers: 3

3.0.11 (2020-04-06)

  • Updated Typescript to 3.8.x
  • Updated Prettier to 2.x

Committers: 2

2.x

Find the 2.x changelog here.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.