sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | google.aiplatform.sessions |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'. |
createTime | string (google-datetime) | Output only. Timestamp when the session was created. |
displayName | string | Optional. The display name of the session. |
expireTime | string (google-datetime) | Optional. Timestamp of when this session is considered expired. This is always provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation. |
labels | object | The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. |
sessionState | object | Optional. Session specific memory which stores key conversation points. |
ttl | string (google-duration) | Optional. Input only. The TTL for this session. The minimum value is 24 hours. |
updateTime | string (google-datetime) | Output only. Timestamp when the session was updated. |
userId | string | Required. Immutable. String id provided by the user |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'. |
createTime | string (google-datetime) | Output only. Timestamp when the session was created. |
displayName | string | Optional. The display name of the session. |
expireTime | string (google-datetime) | Optional. Timestamp of when this session is considered expired. This is always provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation. |
labels | object | The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. |
sessionState | object | Optional. Session specific memory which stores key conversation points. |
ttl | string (google-duration) | Optional. Input only. The TTL for this session. The minimum value is 24 hours. |
updateTime | string (google-datetime) | Output only. Timestamp when the session was updated. |
userId | string | Required. Immutable. String id provided by the user |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, reasoningEnginesId, sessionsId | Gets details of the specific Session. | |
list | select | projectsId, locationsId, reasoningEnginesId | pageSize, filter, orderBy, pageToken | Lists Sessions in a given reasoning engine. |
create | insert | projectsId, locationsId, reasoningEnginesId | Creates a new Session. | |
patch | update | projectsId, locationsId, reasoningEnginesId, sessionsId | updateMask | Updates the specific Session. |
delete | delete | projectsId, locationsId, reasoningEnginesId, sessionsId | Deletes details of the specific Session. | |
append_event | exec | projectsId, locationsId, reasoningEnginesId, sessionsId | Appends an event to a given session. |
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 |
|---|---|---|
locationsId | string | |
projectsId | string | |
reasoningEnginesId | string | |
sessionsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Gets details of the specific Session.
SELECT
name,
createTime,
displayName,
expireTime,
labels,
sessionState,
ttl,
updateTime,
userId
FROM google.aiplatform.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND reasoningEnginesId = '{{ reasoningEnginesId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
;
Lists Sessions in a given reasoning engine.
SELECT
name,
createTime,
displayName,
expireTime,
labels,
sessionState,
ttl,
updateTime,
userId
FROM google.aiplatform.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND reasoningEnginesId = '{{ reasoningEnginesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
Creates a new Session.
INSERT INTO google.aiplatform.sessions (
data__userId,
data__expireTime,
data__sessionState,
data__name,
data__displayName,
data__labels,
data__ttl,
projectsId,
locationsId,
reasoningEnginesId
)
SELECT
'{{ userId }}',
'{{ expireTime }}',
'{{ sessionState }}',
'{{ name }}',
'{{ displayName }}',
'{{ labels }}',
'{{ ttl }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ reasoningEnginesId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# 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: reasoningEnginesId
value: string
description: Required parameter for the sessions resource.
- name: userId
value: string
description: >
Required. Immutable. String id provided by the user
- name: expireTime
value: string
description: >
Optional. Timestamp of when this session is considered expired. This is *always* provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation.
- name: sessionState
value: object
description: >
Optional. Session specific memory which stores key conversation points.
- name: name
value: string
description: >
Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
- name: displayName
value: string
description: >
Optional. The display name of the session.
- name: labels
value: object
description: >
The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
- name: ttl
value: string
description: >
Optional. Input only. The TTL for this session. The minimum value is 24 hours.
UPDATE examples
- patch
Updates the specific Session.
UPDATE google.aiplatform.sessions
SET
data__userId = '{{ userId }}',
data__expireTime = '{{ expireTime }}',
data__sessionState = '{{ sessionState }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__ttl = '{{ ttl }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND reasoningEnginesId = '{{ reasoningEnginesId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
displayName,
expireTime,
labels,
sessionState,
ttl,
updateTime,
userId;
DELETE examples
- delete
Deletes details of the specific Session.
DELETE FROM google.aiplatform.sessions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND reasoningEnginesId = '{{ reasoningEnginesId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
;
Lifecycle Methods
- append_event
Appends an event to a given session.
EXEC google.aiplatform.sessions.append_event
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@reasoningEnginesId='{{ reasoningEnginesId }}' --required,
@sessionsId='{{ sessionsId }}' --required
@@json=
'{
"author": "{{ author }}",
"content": "{{ content }}",
"invocationId": "{{ invocationId }}",
"timestamp": "{{ timestamp }}",
"actions": "{{ actions }}",
"errorCode": "{{ errorCode }}",
"errorMessage": "{{ errorMessage }}",
"eventMetadata": "{{ eventMetadata }}",
"name": "{{ name }}"
}'
;