assistants
Creates, updates, deletes, gets or lists an assistants resource.
Overview
| Name | assistants |
| Type | Resource |
| Id | google.discoveryengine.assistants |
Fields
The following fields are returned by SELECT queries:
- projects_locations_collections_engines_assistants_get
- projects_locations_collections_engines_assistants_list
| Name | Datatype | Description |
|---|---|---|
name | string | Immutable. 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. |
createTime | string (google-datetime) | Output only. Represents the time when this Assistant was created. |
customerPolicy | object | Optional. Customer policy for the assistant. (id: GoogleCloudDiscoveryengineV1AssistantCustomerPolicy) |
defaultWebGroundingToggleOff | boolean | Optional. This field controls the default web grounding toggle for end users if web_grounding_type is set to WEB_GROUNDING_TYPE_GOOGLE_SEARCH or WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH. By default, this field is set to false. If web_grounding_type is WEB_GROUNDING_TYPE_GOOGLE_SEARCH or WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled. |
description | string | Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant. |
displayName | string | Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters. |
enabledTools | object | Optional. 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"),..] } |
generationConfig | object | Optional. Configuration for the generation of the assistant response. (id: GoogleCloudDiscoveryengineV1AssistantGenerationConfig) |
updateTime | string (google-datetime) | Output only. Represents the time when this Assistant was most recently updated. |
webGroundingType | string | Optional. The type of web grounding to use. (WEB_GROUNDING_TYPE_UNSPECIFIED, WEB_GROUNDING_TYPE_DISABLED, WEB_GROUNDING_TYPE_GOOGLE_SEARCH, WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH) |
| Name | Datatype | Description |
|---|---|---|
name | string | Immutable. 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. |
createTime | string (google-datetime) | Output only. Represents the time when this Assistant was created. |
customerPolicy | object | Optional. Customer policy for the assistant. (id: GoogleCloudDiscoveryengineV1AssistantCustomerPolicy) |
defaultWebGroundingToggleOff | boolean | Optional. This field controls the default web grounding toggle for end users if web_grounding_type is set to WEB_GROUNDING_TYPE_GOOGLE_SEARCH or WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH. By default, this field is set to false. If web_grounding_type is WEB_GROUNDING_TYPE_GOOGLE_SEARCH or WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled. |
description | string | Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant. |
displayName | string | Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters. |
enabledTools | object | Optional. 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"),..] } |
generationConfig | object | Optional. Configuration for the generation of the assistant response. (id: GoogleCloudDiscoveryengineV1AssistantGenerationConfig) |
updateTime | string (google-datetime) | Output only. Represents the time when this Assistant was most recently updated. |
webGroundingType | string | Optional. The type of web grounding to use. (WEB_GROUNDING_TYPE_UNSPECIFIED, WEB_GROUNDING_TYPE_DISABLED, WEB_GROUNDING_TYPE_GOOGLE_SEARCH, WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_collections_engines_assistants_get | select | projectsId, locationsId, collectionsId, enginesId, assistantsId | Gets an Assistant. | |
projects_locations_collections_engines_assistants_list | select | projectsId, locationsId, collectionsId, enginesId | pageToken, pageSize | Lists all Assistants under an Engine. |
projects_locations_collections_engines_assistants_create | insert | projectsId, locationsId, collectionsId, enginesId | assistantId | Creates an Assistant. |
projects_locations_collections_engines_assistants_patch | update | projectsId, locationsId, collectionsId, enginesId, assistantsId | updateMask | Updates an Assistant |
projects_locations_collections_engines_assistants_delete | delete | projectsId, locationsId, collectionsId, enginesId, assistantsId | Deletes an Assistant. | |
projects_locations_collections_engines_assistants_stream_assist | exec | projectsId, locationsId, collectionsId, enginesId, assistantsId | Assists 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.
| Name | Datatype | Description |
|---|---|---|
assistantsId | string | |
collectionsId | string | |
enginesId | string | |
locationsId | string | |
projectsId | string | |
assistantId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_locations_collections_engines_assistants_get
- projects_locations_collections_engines_assistants_list
Gets an Assistant.
SELECT
name,
createTime,
customerPolicy,
defaultWebGroundingToggleOff,
description,
displayName,
enabledTools,
generationConfig,
updateTime,
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
;
Lists all Assistants under an Engine.
SELECT
name,
createTime,
customerPolicy,
defaultWebGroundingToggleOff,
description,
displayName,
enabledTools,
generationConfig,
updateTime,
webGroundingType
FROM google.discoveryengine.assistants
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- projects_locations_collections_engines_assistants_create
- Manifest
Creates an Assistant.
INSERT INTO google.discoveryengine.assistants (
data__enabledTools,
data__customerPolicy,
data__description,
data__webGroundingType,
data__generationConfig,
data__defaultWebGroundingToggleOff,
data__name,
data__displayName,
projectsId,
locationsId,
collectionsId,
enginesId,
assistantId
)
SELECT
'{{ enabledTools }}',
'{{ customerPolicy }}',
'{{ description }}',
'{{ webGroundingType }}',
'{{ generationConfig }}',
{{ defaultWebGroundingToggleOff }},
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ enginesId }}',
'{{ assistantId }}'
RETURNING
name,
createTime,
customerPolicy,
defaultWebGroundingToggleOff,
description,
displayName,
enabledTools,
generationConfig,
updateTime,
webGroundingType
;
# Description fields are for documentation purposes
- name: assistants
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the assistants resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the assistants resource.
- name: collectionsId
value: "{{ collectionsId }}"
description: Required parameter for the assistants resource.
- name: enginesId
value: "{{ enginesId }}"
description: Required parameter for the assistants resource.
- name: enabledTools
value: "{{ enabledTools }}"
description: |
Optional. 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"),..] }
- name: customerPolicy
description: |
Optional. Customer policy for the assistant.
value:
modelArmorConfig:
userPromptTemplate: "{{ userPromptTemplate }}"
responseTemplate: "{{ responseTemplate }}"
failureMode: "{{ failureMode }}"
bannedPhrases:
- ignoreDiacritics: {{ ignoreDiacritics }}
matchType: "{{ matchType }}"
phrase: "{{ phrase }}"
- name: description
value: "{{ description }}"
description: |
Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
- name: webGroundingType
value: "{{ webGroundingType }}"
description: |
Optional. The type of web grounding to use.
valid_values: ['WEB_GROUNDING_TYPE_UNSPECIFIED', 'WEB_GROUNDING_TYPE_DISABLED', 'WEB_GROUNDING_TYPE_GOOGLE_SEARCH', 'WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH']
- name: generationConfig
description: |
Optional. Configuration for the generation of the assistant response.
value:
allowedModelIds:
- "{{ allowedModelIds }}"
defaultLanguage: "{{ defaultLanguage }}"
defaultModelId: "{{ defaultModelId }}"
systemInstruction:
additionalSystemInstruction: "{{ additionalSystemInstruction }}"
- name: defaultWebGroundingToggleOff
value: {{ defaultWebGroundingToggleOff }}
description: |
Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
- name: name
value: "{{ name }}"
description: |
Immutable. 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.
- name: displayName
value: "{{ displayName }}"
description: |
Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
- name: assistantId
value: "{{ assistantId }}"
UPDATE examples
- projects_locations_collections_engines_assistants_patch
Updates an Assistant
UPDATE google.discoveryengine.assistants
SET
data__enabledTools = '{{ enabledTools }}',
data__customerPolicy = '{{ customerPolicy }}',
data__description = '{{ description }}',
data__webGroundingType = '{{ webGroundingType }}',
data__generationConfig = '{{ generationConfig }}',
data__defaultWebGroundingToggleOff = {{ defaultWebGroundingToggleOff }},
data__name = '{{ name }}',
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,
createTime,
customerPolicy,
defaultWebGroundingToggleOff,
description,
displayName,
enabledTools,
generationConfig,
updateTime,
webGroundingType;
DELETE examples
- projects_locations_collections_engines_assistants_delete
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
- projects_locations_collections_engines_assistants_stream_assist
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 }}",
"toolsSpec": "{{ toolsSpec }}",
"userMetadata": "{{ userMetadata }}",
"generationSpec": "{{ generationSpec }}"
}'
;