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:

Successful response

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)
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_patchupdateprojectsId, locationsId, collectionsId, enginesId, assistantsIdupdateMaskUpdates 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
updateMaskstring (google-fieldmask)

SELECT examples

Gets an Assistant.

SELECT
name,
customerPolicy,
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;

UPDATE examples

Updates an Assistant

UPDATE google.discoveryengine.assistants
SET
data__name = '{{ name }}',
data__generationConfig = '{{ generationConfig }}',
data__webGroundingType = '{{ webGroundingType }}',
data__enabledTools = '{{ enabledTools }}',
data__customerPolicy = '{{ customerPolicy }}'
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,
enabledTools,
generationConfig,
webGroundingType;

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=
'{
"query": "{{ query }}",
"session": "{{ session }}",
"userMetadata": "{{ userMetadata }}",
"toolsSpec": "{{ toolsSpec }}",
"generationSpec": "{{ generationSpec }}"
}';