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_data_stores_sessions_get
- projects_locations_collections_data_stores_sessions_list
- projects_locations_collections_engines_sessions_list
- projects_locations_data_stores_sessions_list
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
turns | array | Turns. |
userPseudoId | string | A unique identifier for tracking users. |
| 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. |
labels | array | Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
pendingAsyncAssistOperationId | string | Output only. Full resource name of an in-progress AsyncAssist operation for this session, e.g. projects/*/locations/*/collections/*/engines/*/sessions/*/operations/*. Set when the operation starts and cleared when it finishes. |
startTime | string (google-datetime) | Output only. The time the session started. |
state | string | The state of the session. (STATE_UNSPECIFIED, IN_PROGRESS) |
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 | |
sessionId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_locations_collections_data_stores_sessions_get
- projects_locations_collections_engines_sessions_get
- projects_locations_data_stores_sessions_get
- projects_locations_collections_data_stores_sessions_list
- projects_locations_collections_engines_sessions_list
- projects_locations_data_stores_sessions_list
Gets a Session.
SELECT
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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,
labels,
pendingAsyncAssistOperationId,
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 }}'
;
Gets a Session.
SELECT
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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,
labels,
pendingAsyncAssistOperationId,
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 filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
;
Lists all Sessions by their parent DataStore.
SELECT
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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 filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
;
Lists all Sessions by their parent DataStore.
SELECT
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
;
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__isPinned,
data__userPseudoId,
data__labels,
data__state,
data__turns,
data__name,
data__displayName,
projectsId,
locationsId,
collectionsId,
dataStoresId,
sessionId
)
SELECT
{{ isPinned }},
'{{ userPseudoId }}',
'{{ labels }}',
'{{ state }}',
'{{ turns }}',
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ dataStoresId }}',
'{{ sessionId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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__isPinned,
data__userPseudoId,
data__labels,
data__state,
data__turns,
data__name,
data__displayName,
projectsId,
locationsId,
collectionsId,
enginesId,
sessionId
)
SELECT
{{ isPinned }},
'{{ userPseudoId }}',
'{{ labels }}',
'{{ state }}',
'{{ turns }}',
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ enginesId }}',
'{{ sessionId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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__isPinned,
data__userPseudoId,
data__labels,
data__state,
data__turns,
data__name,
data__displayName,
projectsId,
locationsId,
dataStoresId,
sessionId
)
SELECT
{{ isPinned }},
'{{ userPseudoId }}',
'{{ labels }}',
'{{ state }}',
'{{ turns }}',
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataStoresId }}',
'{{ sessionId }}'
RETURNING
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
startTime,
state,
turns,
userPseudoId
;
# Description fields are for documentation purposes
- name: sessions
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the sessions resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the sessions resource.
- name: collectionsId
value: "{{ collectionsId }}"
description: Required parameter for the sessions resource.
- name: dataStoresId
value: "{{ dataStoresId }}"
description: Required parameter for the sessions resource.
- name: enginesId
value: "{{ enginesId }}"
description: Required parameter for the sessions resource.
- name: isPinned
value: {{ isPinned }}
description: |
Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list.
- name: userPseudoId
value: "{{ userPseudoId }}"
description: |
A unique identifier for tracking users.
- name: labels
value:
- "{{ labels }}"
description: |
Optional. The labels for the session. Can be set as filter in ListSessionsRequest.
- name: state
value: "{{ state }}"
description: |
The state of the session.
valid_values: ['STATE_UNSPECIFIED', 'IN_PROGRESS']
- name: turns
description: |
Turns.
value:
- detailedAssistAnswer:
assistSkippedReasons:
- "{{ assistSkippedReasons }}"
replies:
- createTime: "{{ createTime }}"
groundedContent:
textGroundingMetadata:
visualSegments: "{{ visualSegments }}"
segments: "{{ segments }}"
references: "{{ references }}"
content:
text: "{{ text }}"
codeExecutionResult: "{{ codeExecutionResult }}"
executableCode: "{{ executableCode }}"
file: "{{ file }}"
thought: {{ thought }}
inlineData: "{{ inlineData }}"
role: "{{ role }}"
citationMetadata:
citations: "{{ citations }}"
customerPolicyEnforcementResult:
verdict: "{{ verdict }}"
policyResults:
- bannedPhraseEnforcementResult:
bannedPhrases: "{{ bannedPhrases }}"
modelArmorEnforcementResult:
modelArmorViolation: "{{ modelArmorViolation }}"
error: "{{ error }}"
state: "{{ state }}"
name: "{{ name }}"
live: {{ live }}
query:
text: "{{ text }}"
queryId: "{{ queryId }}"
queryConfig: "{{ queryConfig }}"
answer: "{{ answer }}"
detailedAnswer:
name: "{{ name }}"
createTime: "{{ createTime }}"
safetyRatings:
- probability: "{{ probability }}"
severityScore: {{ severityScore }}
severity: "{{ severity }}"
blocked: {{ blocked }}
category: "{{ category }}"
probabilityScore: {{ probabilityScore }}
citations:
- endIndex: "{{ endIndex }}"
startIndex: "{{ startIndex }}"
sources: "{{ sources }}"
answerText: "{{ answerText }}"
groundingSupports:
- endIndex: "{{ endIndex }}"
groundingScore: {{ groundingScore }}
groundingCheckRequired: {{ groundingCheckRequired }}
startIndex: "{{ startIndex }}"
sources: "{{ sources }}"
references:
- unstructuredDocumentInfo:
chunkContents:
- pageIdentifier: "{{ pageIdentifier }}"
relevanceScore: {{ relevanceScore }}
content: "{{ content }}"
document: "{{ document }}"
uri: "{{ uri }}"
title: "{{ title }}"
structData: "{{ structData }}"
chunkInfo:
relevanceScore: {{ relevanceScore }}
chunk: "{{ chunk }}"
content: "{{ content }}"
documentMetadata:
pageIdentifier: "{{ pageIdentifier }}"
document: "{{ document }}"
uri: "{{ uri }}"
title: "{{ title }}"
structData: "{{ structData }}"
structuredDocumentInfo:
structData: "{{ structData }}"
document: "{{ document }}"
title: "{{ title }}"
uri: "{{ uri }}"
completeTime: "{{ completeTime }}"
queryUnderstandingInfo:
queryClassificationInfo:
- type: "{{ type }}"
positive: {{ positive }}
state: "{{ state }}"
steps:
- description: "{{ description }}"
actions: "{{ actions }}"
thought: "{{ thought }}"
state: "{{ state }}"
groundingScore: {{ groundingScore }}
answerSkippedReasons:
- "{{ answerSkippedReasons }}"
relatedQuestions:
- "{{ relatedQuestions }}"
- name: name
value: "{{ name }}"
description: |
Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*`
- name: displayName
value: "{{ displayName }}"
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: sessionId
value: "{{ sessionId }}"
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__isPinned = {{ isPinned }},
data__userPseudoId = '{{ userPseudoId }}',
data__labels = '{{ labels }}',
data__state = '{{ state }}',
data__turns = '{{ turns }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}'
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,
labels,
pendingAsyncAssistOperationId,
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__isPinned = {{ isPinned }},
data__userPseudoId = '{{ userPseudoId }}',
data__labels = '{{ labels }}',
data__state = '{{ state }}',
data__turns = '{{ turns }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}'
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,
labels,
pendingAsyncAssistOperationId,
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__isPinned = {{ isPinned }},
data__userPseudoId = '{{ userPseudoId }}',
data__labels = '{{ labels }}',
data__state = '{{ state }}',
data__turns = '{{ turns }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
endTime,
isPinned,
labels,
pendingAsyncAssistOperationId,
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
;