Skip to main content

assistants

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

Overview

Nameassistants
TypeResource
Idgoogle.discoveryengine.assistants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Resource name of the assistant. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant} It must be a UTF-8 encoded string with a length limit of 1024 characters.
customerPolicyobjectOptional. Customer policy for the assistant. (id: GoogleCloudDiscoveryengineV1AssistantCustomerPolicy)
descriptionstringOptional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
displayNamestringRequired. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
enabledToolsobjectOptional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
generationConfigobjectOptional. Configuration for the generation of the assistant response. (id: GoogleCloudDiscoveryengineV1AssistantGenerationConfig)
webGroundingTypestringOptional. The type of web grounding to use.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_engines_assistants_getselectprojectsId, locationsId, collectionsId, enginesId, assistantsIdGets an Assistant.
projects_locations_collections_engines_assistants_listselectprojectsId, locationsId, collectionsId, enginesIdpageSize, pageTokenLists all Assistants under an Engine.
projects_locations_collections_engines_assistants_createinsertprojectsId, locationsId, collectionsId, enginesIdassistantIdCreates an Assistant.
projects_locations_collections_engines_assistants_patchupdateprojectsId, locationsId, collectionsId, enginesId, assistantsIdupdateMaskUpdates an Assistant
projects_locations_collections_engines_assistants_deletedeleteprojectsId, locationsId, collectionsId, enginesId, assistantsIdDeletes an Assistant.
projects_locations_collections_engines_assistants_stream_assistexecprojectsId, locationsId, collectionsId, enginesId, assistantsIdAssists the user with a query in a streaming fashion.

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
assistantsIdstring
collectionsIdstring
enginesIdstring
locationsIdstring
projectsIdstring
assistantIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets an Assistant.

SELECT
name,
customerPolicy,
description,
displayName,
enabledTools,
generationConfig,
webGroundingType
FROM google.discoveryengine.assistants
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND assistantsId = '{{ assistantsId }}' -- required
;

INSERT examples

Creates an Assistant.

INSERT INTO google.discoveryengine.assistants (
data__enabledTools,
data__description,
data__name,
data__webGroundingType,
data__customerPolicy,
data__generationConfig,
data__displayName,
projectsId,
locationsId,
collectionsId,
enginesId,
assistantId
)
SELECT
'{{ enabledTools }}',
'{{ description }}',
'{{ name }}',
'{{ webGroundingType }}',
'{{ customerPolicy }}',
'{{ generationConfig }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ enginesId }}',
'{{ assistantId }}'
RETURNING
name,
customerPolicy,
description,
displayName,
enabledTools,
generationConfig,
webGroundingType
;

UPDATE examples

Updates an Assistant

UPDATE google.discoveryengine.assistants
SET
data__enabledTools = '{{ enabledTools }}',
data__description = '{{ description }}',
data__name = '{{ name }}',
data__webGroundingType = '{{ webGroundingType }}',
data__customerPolicy = '{{ customerPolicy }}',
data__generationConfig = '{{ generationConfig }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND assistantsId = '{{ assistantsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
customerPolicy,
description,
displayName,
enabledTools,
generationConfig,
webGroundingType;

DELETE examples

Deletes an Assistant.

DELETE FROM google.discoveryengine.assistants
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND assistantsId = '{{ assistantsId }}' --required
;

Lifecycle Methods

Assists the user with a query in a streaming fashion.

EXEC google.discoveryengine.assistants.projects_locations_collections_engines_assistants_stream_assist 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@collectionsId='{{ collectionsId }}' --required,
@enginesId='{{ enginesId }}' --required,
@assistantsId='{{ assistantsId }}' --required
@@json=
'{
"session": "{{ session }}",
"toolsSpec": "{{ toolsSpec }}",
"generationSpec": "{{ generationSpec }}",
"query": "{{ query }}",
"userMetadata": "{{ userMetadata }}"
}'
;