agents
Creates, updates, deletes, gets or lists an agents resource.
Overview
| Name | agents |
| Type | Resource |
| Id | google.ces.agents |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The unique identifier of the agent. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent} |
afterAgentCallbacks | array | Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
afterModelCallbacks | array | Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
afterToolCallbacks | array | Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeAgentCallbacks | array | Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeModelCallbacks | array | Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeToolCallbacks | array | Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
childAgents | array | Optional. List of child agents in the agent tree. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent} |
createTime | string (google-datetime) | Output only. Timestamp when the agent was created. |
description | string | Optional. Human-readable description of the agent. |
displayName | string | Required. Display name of the agent. |
etag | string | Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes. |
generatedSummary | string | Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation. |
guardrails | array | Optional. List of guardrails for the agent. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} |
instruction | string | Optional. Instructions for the LLM model to guide the agent's behavior. |
llmAgent | object | Optional. The default agent type. (id: AgentLlmAgent) |
modelSettings | object | Optional. Configurations for the LLM model. (id: ModelSettings) |
remoteDialogflowAgent | object | Optional. The remote Dialogflow agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant roles/dialogflow.client to the CES service agent service-@gcp-sa-ces.iam.gserviceaccount.com. (id: AgentRemoteDialogflowAgent) |
tools | array | Optional. List of available tools for the agent. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool} |
toolsets | array | Optional. List of toolsets for the agent. |
transferRules | array | Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used. |
updateTime | string (google-datetime) | Output only. Timestamp when the agent was last updated. |
validationErrors | array | Output only. Misconfigurations or errors in the agent that may affect agent quality. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The unique identifier of the agent. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent} |
afterAgentCallbacks | array | Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
afterModelCallbacks | array | Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
afterToolCallbacks | array | Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeAgentCallbacks | array | Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeModelCallbacks | array | Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
beforeToolCallbacks | array | Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. |
childAgents | array | Optional. List of child agents in the agent tree. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent} |
createTime | string (google-datetime) | Output only. Timestamp when the agent was created. |
description | string | Optional. Human-readable description of the agent. |
displayName | string | Required. Display name of the agent. |
etag | string | Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes. |
generatedSummary | string | Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation. |
guardrails | array | Optional. List of guardrails for the agent. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} |
instruction | string | Optional. Instructions for the LLM model to guide the agent's behavior. |
llmAgent | object | Optional. The default agent type. (id: AgentLlmAgent) |
modelSettings | object | Optional. Configurations for the LLM model. (id: ModelSettings) |
remoteDialogflowAgent | object | Optional. The remote Dialogflow agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant roles/dialogflow.client to the CES service agent service-@gcp-sa-ces.iam.gserviceaccount.com. (id: AgentRemoteDialogflowAgent) |
tools | array | Optional. List of available tools for the agent. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool} |
toolsets | array | Optional. List of toolsets for the agent. |
transferRules | array | Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used. |
updateTime | string (google-datetime) | Output only. Timestamp when the agent was last updated. |
validationErrors | array | Output only. Misconfigurations or errors in the agent that may affect agent quality. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, appsId, agentsId | Gets details of the specified agent. | |
list | select | projectsId, locationsId, appsId | filter, orderBy, pageSize, pageToken | Lists agents in the given app. |
create | insert | projectsId, locationsId, appsId | agentId | Creates a new agent in the given app. |
patch | update | projectsId, locationsId, appsId, agentsId | updateMask | Updates the specified agent. |
delete | delete | projectsId, locationsId, appsId, agentsId | force, etag | Deletes the specified agent. |
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 |
|---|---|---|
agentsId | string | |
appsId | string | |
locationsId | string | |
projectsId | string | |
agentId | string | |
etag | string | |
filter | string | |
force | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Gets details of the specified agent.
SELECT
name,
afterAgentCallbacks,
afterModelCallbacks,
afterToolCallbacks,
beforeAgentCallbacks,
beforeModelCallbacks,
beforeToolCallbacks,
childAgents,
createTime,
description,
displayName,
etag,
generatedSummary,
guardrails,
instruction,
llmAgent,
modelSettings,
remoteDialogflowAgent,
tools,
toolsets,
transferRules,
updateTime,
validationErrors
FROM google.ces.agents
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND appsId = '{{ appsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
;
Lists agents in the given app.
SELECT
name,
afterAgentCallbacks,
afterModelCallbacks,
afterToolCallbacks,
beforeAgentCallbacks,
beforeModelCallbacks,
beforeToolCallbacks,
childAgents,
createTime,
description,
displayName,
etag,
generatedSummary,
guardrails,
instruction,
llmAgent,
modelSettings,
remoteDialogflowAgent,
tools,
toolsets,
transferRules,
updateTime,
validationErrors
FROM google.ces.agents
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND appsId = '{{ appsId }}' -- required
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
Creates a new agent in the given app.
INSERT INTO google.ces.agents (
data__beforeToolCallbacks,
data__remoteDialogflowAgent,
data__description,
data__afterModelCallbacks,
data__instruction,
data__tools,
data__beforeAgentCallbacks,
data__etag,
data__guardrails,
data__name,
data__displayName,
data__beforeModelCallbacks,
data__childAgents,
data__afterToolCallbacks,
data__afterAgentCallbacks,
data__toolsets,
data__transferRules,
data__modelSettings,
data__llmAgent,
projectsId,
locationsId,
appsId,
agentId
)
SELECT
'{{ beforeToolCallbacks }}',
'{{ remoteDialogflowAgent }}',
'{{ description }}',
'{{ afterModelCallbacks }}',
'{{ instruction }}',
'{{ tools }}',
'{{ beforeAgentCallbacks }}',
'{{ etag }}',
'{{ guardrails }}',
'{{ name }}',
'{{ displayName }}',
'{{ beforeModelCallbacks }}',
'{{ childAgents }}',
'{{ afterToolCallbacks }}',
'{{ afterAgentCallbacks }}',
'{{ toolsets }}',
'{{ transferRules }}',
'{{ modelSettings }}',
'{{ llmAgent }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ appsId }}',
'{{ agentId }}'
RETURNING
name,
afterAgentCallbacks,
afterModelCallbacks,
afterToolCallbacks,
beforeAgentCallbacks,
beforeModelCallbacks,
beforeToolCallbacks,
childAgents,
createTime,
description,
displayName,
etag,
generatedSummary,
guardrails,
instruction,
llmAgent,
modelSettings,
remoteDialogflowAgent,
tools,
toolsets,
transferRules,
updateTime,
validationErrors
;
# Description fields are for documentation purposes
- name: agents
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the agents resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the agents resource.
- name: appsId
value: "{{ appsId }}"
description: Required parameter for the agents resource.
- name: beforeToolCallbacks
description: |
Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: remoteDialogflowAgent
description: |
Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
value:
environmentId: "{{ environmentId }}"
inputVariableMapping: "{{ inputVariableMapping }}"
outputVariableMapping: "{{ outputVariableMapping }}"
languageCodeVariable: "{{ languageCodeVariable }}"
flowId: "{{ flowId }}"
agent: "{{ agent }}"
respectResponseInterruptionSettings: {{ respectResponseInterruptionSettings }}
- name: description
value: "{{ description }}"
description: |
Optional. Human-readable description of the agent.
- name: afterModelCallbacks
description: |
Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: instruction
value: "{{ instruction }}"
description: |
Optional. Instructions for the LLM model to guide the agent's behavior.
- name: tools
value:
- "{{ tools }}"
description: |
Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
- name: beforeAgentCallbacks
description: |
Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: etag
value: "{{ etag }}"
description: |
Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
- name: guardrails
value:
- "{{ guardrails }}"
description: |
Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
- name: name
value: "{{ name }}"
description: |
Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
- name: displayName
value: "{{ displayName }}"
description: |
Required. Display name of the agent.
- name: beforeModelCallbacks
description: |
Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: childAgents
value:
- "{{ childAgents }}"
description: |
Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
- name: afterToolCallbacks
description: |
Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: afterAgentCallbacks
description: |
Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
value:
- pythonCode: "{{ pythonCode }}"
disabled: {{ disabled }}
description: "{{ description }}"
proactiveExecutionEnabled: {{ proactiveExecutionEnabled }}
- name: toolsets
description: |
Optional. List of toolsets for the agent.
value:
- toolset: "{{ toolset }}"
toolIds: "{{ toolIds }}"
- name: transferRules
description: |
Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
value:
- disablePlannerTransfer:
expressionCondition:
expression: "{{ expression }}"
deterministicTransfer:
pythonCodeCondition:
pythonCode: "{{ pythonCode }}"
expressionCondition:
expression: "{{ expression }}"
childAgent: "{{ childAgent }}"
direction: "{{ direction }}"
- name: modelSettings
description: |
Optional. Configurations for the LLM model.
value:
model: "{{ model }}"
temperature: {{ temperature }}
- name: llmAgent
value: "{{ llmAgent }}"
description: |
Optional. The default agent type.
- name: agentId
value: "{{ agentId }}"
UPDATE examples
- patch
Updates the specified agent.
UPDATE google.ces.agents
SET
data__beforeToolCallbacks = '{{ beforeToolCallbacks }}',
data__remoteDialogflowAgent = '{{ remoteDialogflowAgent }}',
data__description = '{{ description }}',
data__afterModelCallbacks = '{{ afterModelCallbacks }}',
data__instruction = '{{ instruction }}',
data__tools = '{{ tools }}',
data__beforeAgentCallbacks = '{{ beforeAgentCallbacks }}',
data__etag = '{{ etag }}',
data__guardrails = '{{ guardrails }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__beforeModelCallbacks = '{{ beforeModelCallbacks }}',
data__childAgents = '{{ childAgents }}',
data__afterToolCallbacks = '{{ afterToolCallbacks }}',
data__afterAgentCallbacks = '{{ afterAgentCallbacks }}',
data__toolsets = '{{ toolsets }}',
data__transferRules = '{{ transferRules }}',
data__modelSettings = '{{ modelSettings }}',
data__llmAgent = '{{ llmAgent }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND appsId = '{{ appsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
afterAgentCallbacks,
afterModelCallbacks,
afterToolCallbacks,
beforeAgentCallbacks,
beforeModelCallbacks,
beforeToolCallbacks,
childAgents,
createTime,
description,
displayName,
etag,
generatedSummary,
guardrails,
instruction,
llmAgent,
modelSettings,
remoteDialogflowAgent,
tools,
toolsets,
transferRules,
updateTime,
validationErrors;
DELETE examples
- delete
Deletes the specified agent.
DELETE FROM google.ces.agents
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND appsId = '{{ appsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND force = '{{ force }}'
AND etag = '{{ etag }}'
;