Skip to main content

examples

Creates, updates, deletes, gets or lists an examples resource.

Overview

Nameexamples
TypeResource
Idgoogle.dialogflow.examples

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe unique identifier of the playbook example. Format: projects//locations//agents//playbooks//examples/.
actionsarrayRequired. The ordered list of actions performed by the end user and the Dialogflow agent.
conversationStatestringRequired. Example's output state.
createTimestring (google-datetime)Output only. The timestamp of initial example creation.
descriptionstringOptional. The high level concise description of the example. The max number of characters is 200.
displayNamestringRequired. The display name of the example.
languageCodestringOptional. The language code of the example. If not specified, the agent's default language is used. Note: languages must be enabled in the agent before they can be used. Note: example's language code is not currently used in dialogflow agents.
playbookInputobjectOptional. The input to the playbook in the example. (id: GoogleCloudDialogflowCxV3PlaybookInput)
playbookOutputobjectOptional. The output of the playbook in the example. (id: GoogleCloudDialogflowCxV3PlaybookOutput)
tokenCountstring (int64)Output only. Estimated number of tokes current example takes when sent to the LLM.
updateTimestring (google-datetime)Output only. Last time the example was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_agents_playbooks_examples_getselectprojectsId, locationsId, agentsId, playbooksId, examplesIdRetrieves the specified example.
projects_locations_agents_playbooks_examples_listselectprojectsId, locationsId, agentsId, playbooksIdpageSize, pageToken, languageCodeReturns a list of examples in the specified playbook.
projects_locations_agents_playbooks_examples_createinsertprojectsId, locationsId, agentsId, playbooksIdCreates an example in the specified playbook.
projects_locations_agents_playbooks_examples_patchupdateprojectsId, locationsId, agentsId, playbooksId, examplesIdupdateMaskUpdate the specified example.
projects_locations_agents_playbooks_examples_deletedeleteprojectsId, locationsId, agentsId, playbooksId, examplesIdDeletes the specified example.

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.

NameDatatypeDescription
agentsIdstring
examplesIdstring
locationsIdstring
playbooksIdstring
projectsIdstring
languageCodestring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieves the specified example.

SELECT
name,
actions,
conversationState,
createTime,
description,
displayName,
languageCode,
playbookInput,
playbookOutput,
tokenCount,
updateTime
FROM google.dialogflow.examples
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND playbooksId = '{{ playbooksId }}' -- required
AND examplesId = '{{ examplesId }}' -- required;

INSERT examples

Creates an example in the specified playbook.

INSERT INTO google.dialogflow.examples (
data__name,
data__playbookInput,
data__playbookOutput,
data__actions,
data__displayName,
data__description,
data__conversationState,
data__languageCode,
projectsId,
locationsId,
agentsId,
playbooksId
)
SELECT
'{{ name }}',
'{{ playbookInput }}',
'{{ playbookOutput }}',
'{{ actions }}',
'{{ displayName }}',
'{{ description }}',
'{{ conversationState }}',
'{{ languageCode }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ agentsId }}',
'{{ playbooksId }}'
RETURNING
name,
actions,
conversationState,
createTime,
description,
displayName,
languageCode,
playbookInput,
playbookOutput,
tokenCount,
updateTime
;

UPDATE examples

Update the specified example.

UPDATE google.dialogflow.examples
SET
data__name = '{{ name }}',
data__playbookInput = '{{ playbookInput }}',
data__playbookOutput = '{{ playbookOutput }}',
data__actions = '{{ actions }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__conversationState = '{{ conversationState }}',
data__languageCode = '{{ languageCode }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND playbooksId = '{{ playbooksId }}' --required
AND examplesId = '{{ examplesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
actions,
conversationState,
createTime,
description,
displayName,
languageCode,
playbookInput,
playbookOutput,
tokenCount,
updateTime;

DELETE examples

Deletes the specified example.

DELETE FROM google.dialogflow.examples
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND playbooksId = '{{ playbooksId }}' --required
AND examplesId = '{{ examplesId }}' --required;