REST Resource: projects.agent.intents

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(WebhookState),
  "priority": number,
  "isFallback": boolean,
  "mlEnabled": boolean,
  "inputContextNames": [
    string
  ],
  "events": [
    string
  ],
  "trainingPhrases": [
    {
      object(TrainingPhrase)
    }
  ],
  "action": string,
  "outputContexts": [
    {
      object(Context)
    }
  ],
  "resetContexts": boolean,
  "parameters": [
    {
      object(Parameter)
    }
  ],
  "messages": [
    {
      object(Message)
    }
  ],
  "defaultResponsePlatforms": [
    enum(Platform)
  ],
  "rootFollowupIntentName": string,
  "parentFollowupIntentName": string,
  "followupIntentInfo": [
    {
      object(FollowupIntentInfo)
    }
  ],
}
Fields
name

string

Required for all methods except create (create populates the name automatically. The unique identifier of this intent. Format: projects/<Project ID>/agent/intents/<Intent ID>.

displayName

string

Required. The name of this intent.

webhookState

enum(WebhookState)

Required. Indicates whether webhooks are enabled for the intent.

priority

number

Optional. The priority of this intent. Higher numbers represent higher priorities. Zero or negative numbers mean that the intent is disabled.

isFallback

boolean

Optional. Indicates whether this is a fallback intent.

mlEnabled

boolean

Optional. Indicates whether Machine Learning is enabled for the intent. Note: If mlEnabled setting is set to false, then this intent is not taken into account during inference in ML ONLY match mode. Also, auto-markup in the UI is turned off.

inputContextNames[]

string

Optional. The list of context names required for this intent to be triggered. Format: projects/<Project ID>/agent/sessions/-/contexts/<Context ID>.

events[]

string

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[]

object(TrainingPhrase)

Optional. The collection of examples/templates that the agent is trained on.

action

string

Optional. The name of the action associated with the intent.

outputContexts[]

object(Context)

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 lifespanCount to 0 will reset the context when the intent is matched. Format: projects/<Project ID>/agent/sessions/-/contexts/<Context ID>.

resetContexts

boolean

Optional. Indicates whether to delete all contexts in the current session when this intent is matched.

parameters[]

object(Parameter)

Optional. The collection of parameters associated with the intent.

messages[]

object(Message)

Optional. The collection of rich messages corresponding to the Response field in API.AI console.

defaultResponsePlatforms[]

enum(Platform)

Optional. The list of platforms for which the first response will be taken from among the messages assigned to the DEFAULT_PLATFORM.

rootFollowupIntentName

string

The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. Format: projects/<Project ID>/agent/intents/<Intent ID>.

parentFollowupIntentName

string

The unique identifier of the parent intent in the chain of followup intents. It identifies the parent followup intent. Format: projects/<Project ID>/agent/intents/<Intent ID>.

followupIntentInfo[]

object(FollowupIntentInfo)

Optional. Collection of information about all followup intents that have name of this intent as a root_name.

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 or template that the agent is trained on.

JSON representation
{
  "name": string,
  "type": enum(Type),
  "parts": [
    {
      object(Part)
    }
  ],
  "timesAddedCount": number,
}
Fields
name

string

Required. The unique identifier of this training phrase.

type

enum(Type)

Required. The type of the training phrase.

parts[]

object(Part)

Required. The collection of training phrase parts (can be annotated). Fields: entityType, alias and userDefined should be populated only for the annotated parts of the training phrase.

timesAddedCount

number

Optional. Indicates how many times this example or template 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.

Part

Represents a part of a training phrase.

JSON representation
{
  "text": string,
  "entityType": string,
  "alias": string,
  "userDefined": boolean,
}
Fields
text

string

Required. The text corresponding to the example or template, if there are no annotations. For annotated examples, it is the text for one of the example's parts.

entityType

string

Optional. The entity type name prefixed with @. This field is required for the annotated part of the text and applies only to examples.

alias

string

Optional. The parameter name for the value extracted from the annotated part of the example.

userDefined

boolean

Optional. Indicates whether the text was manually annotated by the developer.

Parameter

Represents intent parameters.

JSON representation
{
  "name": string,
  "displayName": string,
  "value": string,
  "defaultValue": string,
  "entityTypeDisplayName": string,
  "mandatory": boolean,
  "prompts": [
    string
  ],
  "isList": boolean,
}
Fields
name

string

The unique identifier of this parameter.

displayName

string

Required. The name of the parameter.

value

string

Optional. The definition of the parameter value. It can be: - a constant string, - a parameter value defined as $parameter_name, - an original parameter value defined as $parameter_name.original, - a parameter value from some context defined as #context_name.parameter_name.

defaultValue

string

Optional. The default value to use when the value yields an empty result. Default values can be extracted from contexts by using the following syntax: #context_name.parameter_name.

entityTypeDisplayName

string

Optional. The name of the entity type, prefixed with @, that describes values of the parameter. If the parameter is required, this must be provided.

mandatory

boolean

Optional. Indicates whether the parameter is required. That is, whether the intent cannot be completed without collecting the parameter value.

prompts[]

string

Optional. The collection of prompts that the agent can present to the user in order to collect value for the parameter.

isList

boolean

Optional. Indicates whether the parameter represents a list of values.

Message

Corresponds to the Response field in API.AI console.

JSON representation
{
  "platform": enum(Platform),

  // Union field message can be only one of the following:
  "text": {
    object(Text)
  },
  "image": {
    object(Image)
  },
  "quickReplies": {
    object(QuickReplies)
  },
  "card": {
    object(Card)
  },
  "payload": {
    object
  },
  "simpleResponses": {
    object(SimpleResponses)
  },
  "basicCard": {
    object(BasicCard)
  },
  "suggestions": {
    object(Suggestions)
  },
  "linkOutSuggestion": {
    object(LinkOutSuggestion)
  },
  "listSelect": {
    object(ListSelect)
  },
  "carouselSelect": {
    object(CarouselSelect)
  },
  // End of list of possible types for union field message.
}
Fields
platform

enum(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

object(Text)

The text response.

image

object(Image)

The image response.

quickReplies

object(QuickReplies)

The quick replies response.

card

object(Card)

The card response.

payload

object (Struct format)

The response containing a custom payload.

simpleResponses

object(SimpleResponses)

The voice and text-only responses for Actions on Google.

basicCard

object(BasicCard)

The basic card response for Actions on Google.

suggestions

object(Suggestions)

The suggestion chips for Actions on Google.

listSelect

object(ListSelect)

The list card response for Actions on Google.

carouselSelect

object(CarouselSelect)

The carousel card response for Actions on Google.

Text

The text response message.

JSON representation
{
  "text": [
    string
  ],
}
Fields
text[]

string

Optional. The collection of the agent's responses.

Image

The image response message.

JSON representation
{
  "imageUri": string,
}
Fields
imageUri

string

Optional. The public URI to an image file.

QuickReplies

The quick replies response message.

JSON representation
{
  "title": string,
  "quickReplies": [
    string
  ],
}
Fields
title

string

Optional. The title of the collection of quick replies.

quickReplies[]

string

Optional. The collection of quick replies.

Card

The card response message.

JSON representation
{
  "title": string,
  "subtitle": string,
  "imageUri": string,
  "buttons": [
    {
      object(Button)
    }
  ],
}
Fields
title

string

Optional. The title of the card.

subtitle

string

Optional. The subtitle of the card.

imageUri

string

Optional. The public URI to an image file for the card.

buttons[]

object(Button)

Optional. The collection of card buttons.

Button

Optional. Contains information about a button.

JSON representation
{
  "text": string,
  "postback": string,
}
Fields
text

string

Optional. The text to show on the button.

postback

string

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(SimpleResponse)
    }
  ],
}
Fields
simpleResponses[]

object(SimpleResponse)

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

string

One of textToSpeech or ssml must be provided. The plain text of the speech output. Mutually exclusive with ssml.

ssml

string

One of textToSpeech or ssml must be provided. Structured spoken response to the user in the SSML format. Mutually exclusive with textToSpeech.

displayText

string

Optional. The text to display.

BasicCard

The basic card message. Useful for displaying information.

JSON representation
{
  "title": string,
  "subtitle": string,
  "formattedText": string,
  "image": {
    object(Image)
  },
  "buttons": [
    {
      object(Button)
    }
  ],
}
Fields
title

string

Optional. The title of the card.

subtitle

string

Optional. The subtitle of the card.

formattedText

string

Required, unless image is present. The body text of the card.

image

object(Image)

Optional. The image for the card.

buttons[]

object(Button)

Optional. The collection of card buttons.

Button

The button object that appears at the bottom of a card.

JSON representation
{
  "title": string,
  "openUriAction": {
    object(OpenUriAction)
  },
}
Fields
title

string

Required. The title of the button.

openUriAction

object(OpenUriAction)

Required. Action to take when a user taps on the button.

OpenUriAction

Opens the given URI.

JSON representation
{
  "uri": string,
}
Fields
uri

string

Required. The HTTP or HTTPS scheme URI.

Suggestions

The collection of suggestions.

JSON representation
{
  "suggestions": [
    {
      object(Suggestion)
    }
  ],
}
Fields
suggestions[]

object(Suggestion)

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

string

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

string

Required. The name of the app or site this chip is linking to.

uri

string

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(Item)
    }
  ],
}
Fields
title

string

Optional. The overall title of the list.

items[]

object(Item)

Required. List items.

Item

An item in the list.

JSON representation
{
  "info": {
    object(SelectItemInfo)
  },
  "title": string,
  "description": string,
  "image": {
    object(Image)
  },
}
Fields
info

object(SelectItemInfo)

Required. Additional information about this option.

title

string

Required. The title of the list item.

description

string

Optional. The main text describing the item.

image

object(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

string

Required. A unique key that will be sent back to the agent if this response is given.

synonyms[]

string

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(Item)
    }
  ],
}
Fields
items[]

object(Item)

Required. Carousel items.

Item

An item in the carousel.

JSON representation
{
  "info": {
    object(SelectItemInfo)
  },
  "title": string,
  "description": string,
  "image": {
    object(Image)
  },
}
Fields
info

object(SelectItemInfo)

Required. Additional info about the option item.

title

string

Required. Title of the carousel item.

description

string

Optional. The body text of the card.

image

object(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.

FollowupIntentInfo

Represents a single followup intent in the chain.

JSON representation
{
  "followupIntentName": string,
  "parentFollowupIntentName": string,
}
Fields
followupIntentName

string

The unique identifier of the followup intent. Format: projects/<Project ID>/agent/intents/<Intent ID>.

parentFollowupIntentName

string

The unique identifier of the followup intent parent. Format: projects/<Project ID>/agent/intents/<Intent ID>.

Methods

batchDelete

Deletes intents in the specified agent.

batchUpdate

Updates/Creates multiple intents in the specified agent.

create

Creates an intent in the specified agent.

delete

Deletes the specified intent.

get

Retrieves the specified intent.

list

Returns the list of all intents in the specified agent.

patch

Updates the specified intent.