Skip to main content

examples

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

Overview

Nameexamples
TypeResource
Idgoogle.ces.examples

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The unique identifier of the example. Format: projects/{project}/locations/{location}/apps/{app}/examples/{example}
createTimestring (google-datetime)Output only. Timestamp when the example was created.
descriptionstringOptional. Human-readable description of the example.
displayNamestringRequired. Display name of the example.
entryAgentstringOptional. The agent that initially handles the conversation. If not specified, the example represents a conversation that is handled by the root agent. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
etagstringEtag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
invalidbooleanOutput only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples.
messagesarrayOptional. The collection of messages that make up the conversation.
updateTimestring (google-datetime)Output only. Timestamp when the example was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, appsId, examplesIdGets details of the specified example.
listselectprojectsId, locationsId, appsIdfilter, orderBy, pageSize, pageTokenLists examples in the given app.
createinsertprojectsId, locationsId, appsIdexampleIdCreates a new example in the given app.
patchupdateprojectsId, locationsId, appsId, examplesIdupdateMaskUpdates the specified example.
deletedeleteprojectsId, locationsId, appsId, examplesIdetagDeletes 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
appsIdstring
examplesIdstring
locationsIdstring
projectsIdstring
etagstring
exampleIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of the specified example.

SELECT
name,
createTime,
description,
displayName,
entryAgent,
etag,
invalid,
messages,
updateTime
FROM google.ces.examples
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND appsId = '{{ appsId }}' -- required
AND examplesId = '{{ examplesId }}' -- required
;

INSERT examples

Creates a new example in the given app.

INSERT INTO google.ces.examples (
data__name,
data__displayName,
data__description,
data__messages,
data__etag,
data__entryAgent,
projectsId,
locationsId,
appsId,
exampleId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ messages }}',
'{{ etag }}',
'{{ entryAgent }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ appsId }}',
'{{ exampleId }}'
RETURNING
name,
createTime,
description,
displayName,
entryAgent,
etag,
invalid,
messages,
updateTime
;

UPDATE examples

Updates the specified example.

UPDATE google.ces.examples
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__messages = '{{ messages }}',
data__etag = '{{ etag }}',
data__entryAgent = '{{ entryAgent }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND appsId = '{{ appsId }}' --required
AND examplesId = '{{ examplesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
entryAgent,
etag,
invalid,
messages,
updateTime;

DELETE examples

Deletes the specified example.

DELETE FROM google.ces.examples
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND appsId = '{{ appsId }}' --required
AND examplesId = '{{ examplesId }}' --required
AND etag = '{{ etag }}'
;