intents
Creates, updates, deletes, gets or lists an intents
resource.
Overview
Name | intents |
Type | Resource |
Id | google.dialogflow.intents |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_agents_intents_get
- projects_locations_agents_intents_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: projects//locations//agents//intents/ . |
description | string | Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters. |
displayName | string | Required. The human-readable name of the intent, unique within the agent. |
isFallback | boolean | 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 | object | 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. |
parameters | array | The collection of parameters associated with the intent. |
priority | integer (int32) | The priority of this intent. Higher numbers represent higher priorities. - If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the Normal priority in the console. - If the supplied value is negative, the intent is ignored in runtime detect intent requests. |
trainingPhrases | array | The collection of training phrases the agent is trained on to identify the intent. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: projects//locations//agents//intents/ . |
description | string | Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters. |
displayName | string | Required. The human-readable name of the intent, unique within the agent. |
isFallback | boolean | 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 | object | 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. |
parameters | array | The collection of parameters associated with the intent. |
priority | integer (int32) | The priority of this intent. Higher numbers represent higher priorities. - If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the Normal priority in the console. - If the supplied value is negative, the intent is ignored in runtime detect intent requests. |
trainingPhrases | array | The collection of training phrases the agent is trained on to identify the intent. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_agents_intents_get | select | projectsId , locationsId , agentsId , intentsId | languageCode | Retrieves the specified intent. |
projects_locations_agents_intents_list | select | projectsId , locationsId , agentsId | languageCode , intentView , pageSize , pageToken | Returns the list of all intents in the specified agent. |
projects_locations_agents_intents_create | insert | projectsId , locationsId , agentsId | languageCode | Creates an intent in the specified agent. Note: You should always train a flow prior to sending it queries. See the training documentation. |
projects_locations_agents_intents_patch | update | projectsId , locationsId , agentsId , intentsId | languageCode , updateMask | Updates the specified intent. Note: You should always train a flow prior to sending it queries. See the training documentation. |
projects_locations_agents_intents_delete | delete | projectsId , locationsId , agentsId , intentsId | Deletes the specified intent. Note: You should always train a flow prior to sending it queries. See the training documentation. | |
projects_locations_agents_intents_import | exec | projectsId , locationsId , agentsId | Imports the specified intents into the agent. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : ImportIntentsMetadata - response : ImportIntentsResponse | |
projects_locations_agents_intents_export | exec | projectsId , locationsId , agentsId | Exports the selected intents. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : ExportIntentsMetadata - response : ExportIntentsResponse |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
agentsId | string | |
intentsId | string | |
locationsId | string | |
projectsId | string | |
intentView | string | |
languageCode | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_agents_intents_get
- projects_locations_agents_intents_list
Retrieves the specified intent.
SELECT
name,
description,
displayName,
isFallback,
labels,
parameters,
priority,
trainingPhrases
FROM google.dialogflow.intents
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND intentsId = '{{ intentsId }}' -- required
AND languageCode = '{{ languageCode }}';
Returns the list of all intents in the specified agent.
SELECT
name,
description,
displayName,
isFallback,
labels,
parameters,
priority,
trainingPhrases
FROM google.dialogflow.intents
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND languageCode = '{{ languageCode }}'
AND intentView = '{{ intentView }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_agents_intents_create
- Manifest
Creates an intent in the specified agent. Note: You should always train a flow prior to sending it queries. See the training documentation.
INSERT INTO google.dialogflow.intents (
data__name,
data__displayName,
data__trainingPhrases,
data__parameters,
data__priority,
data__isFallback,
data__labels,
data__description,
projectsId,
locationsId,
agentsId,
languageCode
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ trainingPhrases }}',
'{{ parameters }}',
{{ priority }},
{{ isFallback }},
'{{ labels }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ agentsId }}',
'{{ languageCode }}'
RETURNING
name,
description,
displayName,
isFallback,
labels,
parameters,
priority,
trainingPhrases
;
# Description fields are for documentation purposes
- name: intents
props:
- name: projectsId
value: string
description: Required parameter for the intents resource.
- name: locationsId
value: string
description: Required parameter for the intents resource.
- name: agentsId
value: string
description: Required parameter for the intents resource.
- name: name
value: string
description: >
The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: `projects//locations//agents//intents/`.
- name: displayName
value: string
description: >
Required. The human-readable name of the intent, unique within the agent.
- name: trainingPhrases
value: array
description: >
The collection of training phrases the agent is trained on to identify the intent.
- name: parameters
value: array
description: >
The collection of parameters associated with the intent.
- name: priority
value: integer
description: >
The priority of this intent. Higher numbers represent higher priorities. - If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the `Normal` priority in the console. - If the supplied value is negative, the intent is ignored in runtime detect intent requests.
- name: isFallback
value: boolean
description: >
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.
- name: labels
value: object
description: >
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.
- name: description
value: string
description: >
Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.
- name: languageCode
value: string
UPDATE
examples
- projects_locations_agents_intents_patch
Updates the specified intent. Note: You should always train a flow prior to sending it queries. See the training documentation.
UPDATE google.dialogflow.intents
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__trainingPhrases = '{{ trainingPhrases }}',
data__parameters = '{{ parameters }}',
data__priority = {{ priority }},
data__isFallback = {{ isFallback }},
data__labels = '{{ labels }}',
data__description = '{{ description }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND intentsId = '{{ intentsId }}' --required
AND languageCode = '{{ languageCode}}'
AND updateMask = '{{ updateMask}}'
RETURNING
name,
description,
displayName,
isFallback,
labels,
parameters,
priority,
trainingPhrases;
DELETE
examples
- projects_locations_agents_intents_delete
Deletes the specified intent. Note: You should always train a flow prior to sending it queries. See the training documentation.
DELETE FROM google.dialogflow.intents
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND intentsId = '{{ intentsId }}' --required;
Lifecycle Methods
- projects_locations_agents_intents_import
- projects_locations_agents_intents_export
Imports the specified intents into the agent. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: ImportIntentsMetadata - response
: ImportIntentsResponse
EXEC google.dialogflow.intents.projects_locations_agents_intents_import
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required
@@json=
'{
"intentsUri": "{{ intentsUri }}",
"intentsContent": "{{ intentsContent }}",
"mergeOption": "{{ mergeOption }}"
}';
Exports the selected intents. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: ExportIntentsMetadata - response
: ExportIntentsResponse
EXEC google.dialogflow.intents.projects_locations_agents_intents_export
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required
@@json=
'{
"intents": "{{ intents }}",
"intentsUri": "{{ intentsUri }}",
"intentsContentInline": {{ intentsContentInline }},
"dataFormat": "{{ dataFormat }}"
}';