Skip to main content

conversations

Creates, updates, deletes, gets or lists a conversations resource.

Overview

Nameconversations
TypeResource
Idgoogle.discoveryengine.conversations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/* or projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*.
endTimestring (google-datetime)Output only. The time the conversation finished.
messagesarrayConversation messages.
startTimestring (google-datetime)Output only. The time the conversation started.
statestringThe state of the Conversation.
userPseudoIdstringA unique identifier for tracking users.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_data_stores_conversations_getselectprojectsId, locationsId, collectionsId, dataStoresId, conversationsIdGets a Conversation.
projects_locations_collections_engines_conversations_getselectprojectsId, locationsId, collectionsId, enginesId, conversationsIdGets a Conversation.
projects_locations_collections_data_stores_conversations_listselectprojectsId, locationsId, collectionsId, dataStoresIdpageSize, pageToken, filter, orderByLists all Conversations by their parent DataStore.
projects_locations_collections_engines_conversations_listselectprojectsId, locationsId, collectionsId, enginesIdpageSize, pageToken, filter, orderByLists all Conversations by their parent DataStore.
projects_locations_data_stores_conversations_getselectprojectsId, locationsId, dataStoresId, conversationsIdGets a Conversation.
projects_locations_data_stores_conversations_listselectprojectsId, locationsId, dataStoresIdpageSize, pageToken, filter, orderByLists all Conversations by their parent DataStore.
projects_locations_collections_data_stores_conversations_createinsertprojectsId, locationsId, collectionsId, dataStoresIdCreates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_engines_conversations_createinsertprojectsId, locationsId, collectionsId, enginesIdCreates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_data_stores_conversations_createinsertprojectsId, locationsId, dataStoresIdCreates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_data_stores_conversations_patchupdateprojectsId, locationsId, collectionsId, dataStoresId, conversationsIdupdateMaskUpdates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_conversations_patchupdateprojectsId, locationsId, collectionsId, enginesId, conversationsIdupdateMaskUpdates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_conversations_patchupdateprojectsId, locationsId, dataStoresId, conversationsIdupdateMaskUpdates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.
projects_locations_collections_data_stores_conversations_deletedeleteprojectsId, locationsId, collectionsId, dataStoresId, conversationsIdDeletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_conversations_deletedeleteprojectsId, locationsId, collectionsId, enginesId, conversationsIdDeletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_conversations_deletedeleteprojectsId, locationsId, dataStoresId, conversationsIdDeletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_data_stores_conversations_converseexecprojectsId, locationsId, collectionsId, dataStoresId, conversationsIdConverses a conversation.
projects_locations_collections_engines_conversations_converseexecprojectsId, locationsId, collectionsId, enginesId, conversationsIdConverses a conversation.
projects_locations_data_stores_conversations_converseexecprojectsId, locationsId, dataStoresId, conversationsIdConverses a conversation.

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
collectionsIdstring
conversationsIdstring
dataStoresIdstring
enginesIdstring
locationsIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a Conversation.

SELECT
name,
endTime,
messages,
startTime,
state,
userPseudoId
FROM google.discoveryengine.conversations
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND conversationsId = '{{ conversationsId }}' -- required;

INSERT examples

Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.

INSERT INTO google.discoveryengine.conversations (
data__name,
data__state,
data__userPseudoId,
data__messages,
projectsId,
locationsId,
collectionsId,
dataStoresId
)
SELECT
'{{ name }}',
'{{ state }}',
'{{ userPseudoId }}',
'{{ messages }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ dataStoresId }}'
RETURNING
name,
endTime,
messages,
startTime,
state,
userPseudoId
;

UPDATE examples

Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.

UPDATE google.discoveryengine.conversations
SET
data__name = '{{ name }}',
data__state = '{{ state }}',
data__userPseudoId = '{{ userPseudoId }}',
data__messages = '{{ messages }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND conversationsId = '{{ conversationsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
endTime,
messages,
startTime,
state,
userPseudoId;

DELETE examples

Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.

DELETE FROM google.discoveryengine.conversations
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND conversationsId = '{{ conversationsId }}' --required;

Lifecycle Methods

Converses a conversation.

EXEC google.discoveryengine.conversations.projects_locations_collections_data_stores_conversations_converse 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@collectionsId='{{ collectionsId }}' --required,
@dataStoresId='{{ dataStoresId }}' --required,
@conversationsId='{{ conversationsId }}' --required
@@json=
'{
"query": "{{ query }}",
"servingConfig": "{{ servingConfig }}",
"conversation": "{{ conversation }}",
"safeSearch": {{ safeSearch }},
"userLabels": "{{ userLabels }}",
"summarySpec": "{{ summarySpec }}",
"filter": "{{ filter }}",
"boostSpec": "{{ boostSpec }}"
}';