- Resource: Intent
- WebhookState
- TrainingPhrase
- Type
- Part
- Parameter
- Message
- Text
- Image
- QuickReplies
- Card
- Button
- SimpleResponses
- SimpleResponse
- BasicCard
- Button
- OpenUriAction
- Suggestions
- Suggestion
- LinkOutSuggestion
- ListSelect
- Item
- SelectItemInfo
- CarouselSelect
- Item
- Platform
- FollowupIntentInfo
- Methods
Resource: Intent
Represents an intent. Intents convert a number of user expressions or patterns into an action. An action is an extraction of a user command or sentence semantics.
JSON representation | |
---|---|
{ "name": string, "displayName": string, "webhookState": enum( |
Fields | |
---|---|
name |
The unique identifier of this intent. Required for |
displayName |
Required. The name of this intent. |
webhookState |
Optional. Indicates whether webhooks are enabled for the intent. |
priority |
Optional. The priority of this intent. Higher numbers represent higher priorities. If this is zero or unspecified, we use the default priority 500000. Negative numbers mean that the intent is disabled. |
isFallback |
Optional. Indicates whether this is a fallback intent. |
mlDisabled |
Optional. Indicates whether Machine Learning is disabled for the intent. Note: If |
inputContextNames[] |
Optional. The list of context names required for this intent to be triggered. Format: |
events[] |
Optional. The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. |
trainingPhrases[] |
Optional. The collection of examples that the agent is trained on. |
action |
Optional. The name of the action associated with the intent. Note: The action name must not contain whitespaces. |
outputContexts[] |
Optional. The collection of contexts that are activated when the intent is matched. Context messages in this collection should not set the parameters field. Setting the |
resetContexts |
Optional. Indicates whether to delete all contexts in the current session when this intent is matched. |
parameters[] |
Optional. The collection of parameters associated with the intent. |
messages[] |
Optional. The collection of rich messages corresponding to the |
defaultResponsePlatforms[] |
Optional. The list of platforms for which the first response will be taken from among the messages assigned to the DEFAULT_PLATFORM. |
rootFollowupIntentName |
Read-only. The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. We populate this field only in the output. Format: |
parentFollowupIntentName |
Read-only after creation. The unique identifier of the parent intent in the chain of followup intents. You can set this field when creating an intent, for example with [intents.create][] or [intents.batchUpdate][], in order to make this intent a followup intent. It identifies the parent followup intent. Format: |
followupIntentInfo[] |
Read-only. Information about all followup intents that have this intent as a direct or indirect parent. We populate this field only in the output. |
WebhookState
Represents the different states that webhooks can be in.
Enums | |
---|---|
WEBHOOK_STATE_UNSPECIFIED |
Webhook is disabled in the agent and in the intent. |
WEBHOOK_STATE_ENABLED |
Webhook is enabled in the agent and in the intent. |
WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING |
Webhook is enabled in the agent and in the intent. Also, each slot filling prompt is forwarded to the webhook. |
TrainingPhrase
Represents an example that the agent is trained on.
JSON representation | |
---|---|
{ "name": string, "type": enum( |
Fields | |
---|---|
name |
Output only. The unique identifier of this training phrase. |
type |
Required. The type of the training phrase. |
parts[] |
Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. Note: The API does not automatically annotate training phrases like the Dialogflow Console does. Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated. If the training phrase does not need to be annotated with parameters, you just need a single part with only the If you want to annotate the training phrase, you must create multiple parts, where the fields of each part are populated in one of two ways:
|
timesAddedCount |
Optional. Indicates how many times this example was added to the intent. Each time a developer adds an existing sample by editing an intent or training, this counter is increased. |
Type
Represents different types of training phrases.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Not specified. This value should never be used. |
EXAMPLE |
Examples do not contain @-prefixed entity type names, but example parts can be annotated with entity types. |
TEMPLATE |
Templates are not annotated with entity types, but they can contain @-prefixed entity type names as substrings. Template mode has been deprecated. Example mode is the only supported way to create new training phrases. If you have existing training phrases that you've created in template mode, those will continue to work. |
Part
Represents a part of a training phrase.
JSON representation | |
---|---|
{ "text": string, "entityType": string, "alias": string, "userDefined": boolean } |
Fields | |
---|---|
text |
Required. The text for this part. |
entityType |
Optional. The entity type name prefixed with |
alias |
Optional. The parameter name for the value extracted from the annotated part of the example. This field is required for annotated parts of the training phrase. |
userDefined |
Optional. Indicates whether the text was manually annotated. This field is set to true when the Dialogflow Console is used to manually annotate the part. When creating an annotated part with the API, you must set this to true. |
Parameter
Represents intent parameters.
JSON representation | |
---|---|
{ "name": string, "displayName": string, "value": string, "defaultValue": string, "entityTypeDisplayName": string, "mandatory": boolean, "prompts": [ string ], "isList": boolean } |
Fields | |
---|---|
name |
The unique identifier of this parameter. |
displayName |
Required. The name of the parameter. |
value |
Optional. The definition of the parameter value. It can be: - a constant string, - a parameter value defined as |
defaultValue |
Optional. The default value to use when the |
entityTypeDisplayName |
Optional. The name of the entity type, prefixed with |
mandatory |
Optional. Indicates whether the parameter is required. That is, whether the intent cannot be completed without collecting the parameter value. |
prompts[] |
Optional. The collection of prompts that the agent can present to the user in order to collect value for the parameter. |
isList |
Optional. Indicates whether the parameter represents a list of values. |
Message
Corresponds to the Response
field in the Dialogflow console.
JSON representation | |
---|---|
{ "platform": enum( |
Fields | ||
---|---|---|
platform |
Optional. The platform that this message is intended for. |
|
Union field message . Required. The rich response message. message can be only one of the following: |
||
text |
The text response. |
|
image |
The image response. |
|
quickReplies |
The quick replies response. |
|
card |
The card response. |
|
payload |
Returns a response containing a custom, platform-specific payload. See the Intent.Message.Platform type for a description of the structure that may be required for your platform. |
|
simpleResponses |
The voice and text-only responses for Actions on Google. |
|
basicCard |
The basic card response for Actions on Google. |
|
suggestions |
The suggestion chips for Actions on Google. |
|
linkOutSuggestion |
The link out suggestion chip for Actions on Google. |
|
listSelect |
The list card response for Actions on Google. |
|
carouselSelect |
The carousel card response for Actions on Google. |
Text
The text response message.
JSON representation | |
---|---|
{ "text": [ string ] } |
Fields | |
---|---|
text[] |
Optional. The collection of the agent's responses. |
Image
The image response message.
JSON representation | |
---|---|
{ "imageUri": string, "accessibilityText": string } |
Fields | |
---|---|
imageUri |
Optional. The public URI to an image file. |
accessibilityText |
Optional. A text description of the image to be used for accessibility, e.g., screen readers. |
QuickReplies
The quick replies response message.
JSON representation | |
---|---|
{ "title": string, "quickReplies": [ string ] } |
Fields | |
---|---|
title |
Optional. The title of the collection of quick replies. |
quickReplies[] |
Optional. The collection of quick replies. |
Card
The card response message.
JSON representation | |
---|---|
{
"title": string,
"subtitle": string,
"imageUri": string,
"buttons": [
{
object( |
Fields | |
---|---|
title |
Optional. The title of the card. |
subtitle |
Optional. The subtitle of the card. |
imageUri |
Optional. The public URI to an image file for the card. |
buttons[] |
Optional. The collection of card buttons. |
Button
Optional. Contains information about a button.
JSON representation | |
---|---|
{ "text": string, "postback": string } |
Fields | |
---|---|
text |
Optional. The text to show on the button. |
postback |
Optional. The text to send back to the Dialogflow API or a URI to open. |
SimpleResponses
The collection of simple response candidates. This message in QueryResult.fulfillment_messages
and WebhookResponse.fulfillment_messages
should contain only one SimpleResponse
.
JSON representation | |
---|---|
{
"simpleResponses": [
{
object( |
Fields | |
---|---|
simpleResponses[] |
Required. The list of simple responses. |
SimpleResponse
The simple response message containing speech or text.
JSON representation | |
---|---|
{ "textToSpeech": string, "ssml": string, "displayText": string } |
Fields | |
---|---|
textToSpeech |
One of textToSpeech or ssml must be provided. The plain text of the speech output. Mutually exclusive with ssml. |
ssml |
One of textToSpeech or ssml must be provided. Structured spoken response to the user in the SSML format. Mutually exclusive with textToSpeech. |
displayText |
Optional. The text to display. |
BasicCard
The basic card message. Useful for displaying information.
JSON representation | |
---|---|
{ "title": string, "subtitle": string, "formattedText": string, "image": { object( |
Fields | |
---|---|
title |
Optional. The title of the card. |
subtitle |
Optional. The subtitle of the card. |
formattedText |
Required, unless image is present. The body text of the card. |
image |
Optional. The image for the card. |
buttons[] |
Optional. The collection of card buttons. |
Button
The button object that appears at the bottom of a card.
JSON representation | |
---|---|
{
"title": string,
"openUriAction": {
object( |
Fields | |
---|---|
title |
Required. The title of the button. |
openUriAction |
Required. Action to take when a user taps on the button. |
OpenUriAction
Opens the given URI.
JSON representation | |
---|---|
{ "uri": string } |
Fields | |
---|---|
uri |
Required. The HTTP or HTTPS scheme URI. |
Suggestions
The collection of suggestions.
JSON representation | |
---|---|
{
"suggestions": [
{
object( |
Fields | |
---|---|
suggestions[] |
Required. The list of suggested replies. |
Suggestion
The suggestion chip message that the user can tap to quickly post a reply to the conversation.
JSON representation | |
---|---|
{ "title": string } |
Fields | |
---|---|
title |
Required. The text shown the in the suggestion chip. |
LinkOutSuggestion
The suggestion chip message that allows the user to jump out to the app or website associated with this agent.
JSON representation | |
---|---|
{ "destinationName": string, "uri": string } |
Fields | |
---|---|
destinationName |
Required. The name of the app or site this chip is linking to. |
uri |
Required. The URI of the app or site to open when the user taps the suggestion chip. |
ListSelect
The card for presenting a list of options to select from.
JSON representation | |
---|---|
{
"title": string,
"items": [
{
object( |
Fields | |
---|---|
title |
Optional. The overall title of the list. |
items[] |
Required. List items. |
Item
An item in the list.
JSON representation | |
---|---|
{ "info": { object( |
Fields | |
---|---|
info |
Required. Additional information about this option. |
title |
Required. The title of the list item. |
description |
Optional. The main text describing the item. |
image |
Optional. The image to display. |
SelectItemInfo
Additional info about the select item for when it is triggered in a dialog.
JSON representation | |
---|---|
{ "key": string, "synonyms": [ string ] } |
Fields | |
---|---|
key |
Required. A unique key that will be sent back to the agent if this response is given. |
synonyms[] |
Optional. A list of synonyms that can also be used to trigger this item in dialog. |
CarouselSelect
The card for presenting a carousel of options to select from.
JSON representation | |
---|---|
{
"items": [
{
object( |
Fields | |
---|---|
items[] |
Required. Carousel items. |
Item
An item in the carousel.
JSON representation | |
---|---|
{ "info": { object( |
Fields | |
---|---|
info |
Required. Additional info about the option item. |
title |
Required. Title of the carousel item. |
description |
Optional. The body text of the card. |
image |
Optional. The image to display. |
Platform
Represents different platforms that a rich message can be intended for.
Enums | |
---|---|
PLATFORM_UNSPECIFIED |
Not specified. |
FACEBOOK |
Facebook. |
SLACK |
Slack. |
TELEGRAM |
Telegram. |
KIK |
Kik. |
SKYPE |
Skype. |
LINE |
Line. |
VIBER |
Viber. |
ACTIONS_ON_GOOGLE |
Actions on Google. When using Actions on Google, you can choose one of the specific Intent.Message types that mention support for Actions on Google, or you can use the advanced Intent.Message.payload field. The payload field provides access to AoG features not available in the specific message types. If using the Intent.Message.payload field, it should have a structure similar to the JSON message shown here. For more information, see Actions on Google Webhook Format { "expectUserResponse": true, "isSsml": false, "noInputPrompts": [], "richResponse": { "items": [ { "simpleResponse": { "displayText": "hi", "textToSpeech": "hello" } } ], "suggestions": [ { "title": "Say this" }, { "title": "or this" } ] }, "systemIntent": { "data": { "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec", "listSelect": { "items": [ { "optionInfo": { "key": "key1", "synonyms": [ "key one" ] }, "title": "must not be empty, but unique" }, { "optionInfo": { "key": "key2", "synonyms": [ "key two" ] }, "title": "must not be empty, but unique" } ] } }, "intent": "actions.intent.OPTION" } } |
FollowupIntentInfo
Represents a single followup intent in the chain.
JSON representation | |
---|---|
{ "followupIntentName": string, "parentFollowupIntentName": string } |
Fields | |
---|---|
followupIntentName |
The unique identifier of the followup intent. Format: |
parentFollowupIntentName |
The unique identifier of the followup intent's parent. Format: |
Methods |
|
---|---|
|
Deletes intents in the specified agent. |
|
Updates/Creates multiple intents in the specified agent. |
|
Creates an intent in the specified agent. |
|
Deletes the specified intent and its direct or indirect followup intents. |
|
Retrieves the specified intent. |
|
Returns the list of all intents in the specified agent. |
|
Updates the specified intent. |