Skip to main content

assistant_sessions

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

Overview

Nameassistant_sessions
TypeResource
Idgoogle.contactcenterinsights.assistant_sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Resource name of the session. Format: projects/{project}/locations/{location}/assistantSessions/{assistant_session}
createTimestring (google-datetime)Output only. The time the session was created.
displayNamestringOptional. The display name of the session.
messagesarrayOptional. History of messages in the session.
requesterstringOutput only. The user who initiated the session.
statestringOutput only. The status of the session. (STATE_UNSPECIFIED, PROCESSING, IDLE)
updateTimestring (google-datetime)Output only. The time the session was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, assistantSessionsIdGets an assistant session.
listselectprojectsId, locationsIdpageSize, pageToken, filterLists assistant sessions.
createinsertprojectsId, locationsIdassistantSessionIdCreates an assistant session.
stream_chatexecprojectsId, locationsId, assistantSessionsIdStreams chat messages from the assistant.

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
assistantSessionsIdstring
locationsIdstring
projectsIdstring
assistantSessionIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets an assistant session.

SELECT
name,
createTime,
displayName,
messages,
requester,
state,
updateTime
FROM google.contactcenterinsights.assistant_sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND assistantSessionsId = '{{ assistantSessionsId }}' -- required
;

INSERT examples

Creates an assistant session.

INSERT INTO google.contactcenterinsights.assistant_sessions (
data__messages,
data__name,
data__displayName,
projectsId,
locationsId,
assistantSessionId
)
SELECT
'{{ messages }}',
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ assistantSessionId }}'
RETURNING
name,
createTime,
displayName,
messages,
requester,
state,
updateTime
;

Lifecycle Methods

Streams chat messages from the assistant.

EXEC google.contactcenterinsights.assistant_sessions.stream_chat
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@assistantSessionsId='{{ assistantSessionsId }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;