Resource: Intent
An intent represents a user's intent to interact with a conversational agent.
You can provide information for the Dialogflow API to use to match user input to an intent by adding training phrases (i.e., examples of user input) to your intent.
JSON representation |
---|
{ "name": string, "displayName": string, "trainingPhrases": [ { object ( |
Fields | |
---|---|
name |
The unique identifier of the intent. Required for the |
displayName |
Required. The human-readable name of the intent, unique within the agent. |
trainingPhrases[] |
The collection of training phrases the agent is trained on to identify the intent. |
parameters[] |
The collection of parameters associated with the intent. |
priority |
The priority of this intent. Higher numbers represent higher priorities.
|
isFallback |
Indicates whether this is a fallback intent. Currently only default fallback intent is allowed in the agent, which is added upon agent creation. Adding training phrases to fallback intent is useful in the case of requests that are mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event. |
labels |
The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include: * sys-head * sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys.contextual" means the intent is a contextual intent. An object containing a list of |
description |
Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters. |
TrainingPhrase
Represents an example that the agent is trained on to identify the intent.
JSON representation |
---|
{
"id": string,
"parts": [
{
object ( |
Fields | |
---|---|
id |
Output only. The unique identifier 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:
|
repeatCount |
Indicates how many times this example was added to the intent. |
Part
Represents a part of a training phrase.
JSON representation |
---|
{ "text": string, "parameterId": string } |
Fields | |
---|---|
text |
Required. The text for this part. |
parameterId |
The |
Parameter
Represents an intent parameter.
JSON representation |
---|
{ "id": string, "entityType": string, "isList": boolean, "redact": boolean } |
Fields | |
---|---|
id |
Required. The unique identifier of the parameter. This field is used by |
entityType |
Required. The entity type of the parameter. Format: |
isList |
Indicates whether the parameter represents a list of values. |
redact |
Indicates whether the parameter content should be redacted in log. If redaction is enabled, the parameter content will be replaced by parameter name during logging. Note: the parameter content is subject to redaction if either parameter level redaction or |
Methods |
|
---|---|
|
Creates an intent in the specified agent. |
|
Deletes the specified intent. |
|
Exports the selected intents. |
|
Retrieves the specified intent. |
|
Imports the specified intents into the agent. |
|
Returns the list of all intents in the specified agent. |
|
Updates the specified intent. |