examples
Creates, updates, deletes, gets or lists an examples resource.
Overview
| Name | examples |
| Type | Resource |
| Id | google.ces.examples |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The unique identifier of the example. Format: projects/{project}/locations/{location}/apps/{app}/examples/{example} |
createTime | string (google-datetime) | Output only. Timestamp when the example was created. |
description | string | Optional. Human-readable description of the example. |
displayName | string | Required. Display name of the example. |
entryAgent | string | Optional. 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} |
etag | string | Etag 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. |
invalid | boolean | Output only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples. |
messages | array | Optional. The collection of messages that make up the conversation. |
updateTime | string (google-datetime) | Output only. Timestamp when the example was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The unique identifier of the example. Format: projects/{project}/locations/{location}/apps/{app}/examples/{example} |
createTime | string (google-datetime) | Output only. Timestamp when the example was created. |
description | string | Optional. Human-readable description of the example. |
displayName | string | Required. Display name of the example. |
entryAgent | string | Optional. 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} |
etag | string | Etag 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. |
invalid | boolean | Output only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples. |
messages | array | Optional. The collection of messages that make up the conversation. |
updateTime | string (google-datetime) | Output only. Timestamp when the example was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, appsId, examplesId | Gets details of the specified example. | |
list | select | projectsId, locationsId, appsId | filter, orderBy, pageSize, pageToken | Lists examples in the given app. |
create | insert | projectsId, locationsId, appsId | exampleId | Creates a new example in the given app. |
patch | update | projectsId, locationsId, appsId, examplesId | updateMask | Updates the specified example. |
delete | delete | projectsId, locationsId, appsId, examplesId | etag | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
appsId | string | |
examplesId | string | |
locationsId | string | |
projectsId | string | |
etag | string | |
exampleId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
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
;
Lists examples in the given app.
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 filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: examples
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the examples resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the examples resource.
- name: appsId
value: "{{ appsId }}"
description: Required parameter for the examples resource.
- name: name
value: "{{ name }}"
description: |
Identifier. The unique identifier of the example. Format: `projects/{project}/locations/{location}/apps/{app}/examples/{example}`
- name: displayName
value: "{{ displayName }}"
description: |
Required. Display name of the example.
- name: description
value: "{{ description }}"
description: |
Optional. Human-readable description of the example.
- name: messages
description: |
Optional. The collection of messages that make up the conversation.
value:
- chunks: "{{ chunks }}"
eventTime: "{{ eventTime }}"
role: "{{ role }}"
- name: etag
value: "{{ etag }}"
description: |
Etag 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.
- name: entryAgent
value: "{{ entryAgent }}"
description: |
Optional. 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}`
- name: exampleId
value: "{{ exampleId }}"
UPDATE examples
- patch
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
- delete
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 }}'
;