sessions
Creates, updates, deletes, gets or lists a sessions
resource.
Overview
Name | sessions |
Type | Resource |
Id | google.discoveryengine.sessions |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_collections_data_stores_sessions_get
- projects_locations_collections_engines_sessions_get
- projects_locations_collections_data_stores_sessions_list
- projects_locations_collections_engines_sessions_list
- projects_locations_data_stores_sessions_get
- projects_locations_data_stores_sessions_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/* |
displayName | string | Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
endTime | string (google-datetime) | Output only. The time the session finished. |
isPinned | boolean | Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
Methods
The following methods are available for this resource:
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 |
---|---|---|
collectionsId | string | |
dataStoresId | string | |
enginesId | string | |
locationsId | string | |
projectsId | string | |
sessionsId | string | |
filter | string | |
includeAnswerDetails | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_collections_data_stores_sessions_get
- projects_locations_collections_engines_sessions_get
- projects_locations_collections_data_stores_sessions_list
- projects_locations_collections_engines_sessions_list
- projects_locations_data_stores_sessions_get
- projects_locations_data_stores_sessions_list
Gets a Session.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
AND includeAnswerDetails = '{{ includeAnswerDetails }}';
Gets a Session.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
AND includeAnswerDetails = '{{ includeAnswerDetails }}';
Lists all Sessions by their parent DataStore.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
Lists all Sessions by their parent DataStore.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
Gets a Session.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
AND includeAnswerDetails = '{{ includeAnswerDetails }}';
Lists all Sessions by their parent DataStore.
SELECT
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- projects_locations_collections_data_stores_sessions_create
- projects_locations_collections_engines_sessions_create
- projects_locations_data_stores_sessions_create
- Manifest
Creates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
INSERT INTO google.discoveryengine.sessions (
data__name,
data__displayName,
data__state,
data__userPseudoId,
data__turns,
data__isPinned,
projectsId,
locationsId,
collectionsId,
dataStoresId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ state }}',
'{{ userPseudoId }}',
'{{ turns }}',
{{ isPinned }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ dataStoresId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
;
Creates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
INSERT INTO google.discoveryengine.sessions (
data__name,
data__displayName,
data__state,
data__userPseudoId,
data__turns,
data__isPinned,
projectsId,
locationsId,
collectionsId,
enginesId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ state }}',
'{{ userPseudoId }}',
'{{ turns }}',
{{ isPinned }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ enginesId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
;
Creates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
INSERT INTO google.discoveryengine.sessions (
data__name,
data__displayName,
data__state,
data__userPseudoId,
data__turns,
data__isPinned,
projectsId,
locationsId,
dataStoresId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ state }}',
'{{ userPseudoId }}',
'{{ turns }}',
{{ isPinned }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataStoresId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId
;
# Description fields are for documentation purposes
- name: sessions
props:
- name: projectsId
value: string
description: Required parameter for the sessions resource.
- name: locationsId
value: string
description: Required parameter for the sessions resource.
- name: collectionsId
value: string
description: Required parameter for the sessions resource.
- name: dataStoresId
value: string
description: Required parameter for the sessions resource.
- name: enginesId
value: string
description: Required parameter for the sessions resource.
- name: name
value: string
description: >
Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*`
- name: displayName
value: string
description: >
Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session.
- name: state
value: string
description: >
The state of the session.
valid_values: ['STATE_UNSPECIFIED', 'IN_PROGRESS']
- name: userPseudoId
value: string
description: >
A unique identifier for tracking users.
- name: turns
value: array
description: >
Turns.
- name: isPinned
value: boolean
description: >
Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list.
UPDATE
examples
- projects_locations_collections_data_stores_sessions_patch
- projects_locations_collections_engines_sessions_patch
- projects_locations_data_stores_sessions_patch
Updates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
UPDATE google.discoveryengine.sessions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__state = '{{ state }}',
data__userPseudoId = '{{ userPseudoId }}',
data__turns = '{{ turns }}',
data__isPinned = {{ isPinned }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId;
Updates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
UPDATE google.discoveryengine.sessions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__state = '{{ state }}',
data__userPseudoId = '{{ userPseudoId }}',
data__turns = '{{ turns }}',
data__isPinned = {{ isPinned }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId;
Updates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
UPDATE google.discoveryengine.sessions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__state = '{{ state }}',
data__userPseudoId = '{{ userPseudoId }}',
data__turns = '{{ turns }}',
data__isPinned = {{ isPinned }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
endTime,
isPinned,
startTime,
state,
turns,
userPseudoId;
DELETE
examples
- projects_locations_collections_data_stores_sessions_delete
- projects_locations_collections_engines_sessions_delete
- projects_locations_data_stores_sessions_delete
Deletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
DELETE FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND sessionsId = '{{ sessionsId }}' --required;
Deletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
DELETE FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND sessionsId = '{{ sessionsId }}' --required;
Deletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
DELETE FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND sessionsId = '{{ sessionsId }}' --required;