Skip to main content

agents

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

Overview

Nameagents
TypeResource
Idgoogle.ces.agents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The unique identifier of the agent. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
afterAgentCallbacksarrayOptional. 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.
afterModelCallbacksarrayOptional. 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.
afterToolCallbacksarrayOptional. 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.
beforeAgentCallbacksarrayOptional. 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.
beforeModelCallbacksarrayOptional. 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.
beforeToolCallbacksarrayOptional. 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.
childAgentsarrayOptional. List of child agents in the agent tree. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
createTimestring (google-datetime)Output only. Timestamp when the agent was created.
descriptionstringOptional. Human-readable description of the agent.
displayNamestringRequired. Display name of the agent.
etagstringEtag 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.
generatedSummarystringOutput only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
guardrailsarrayOptional. List of guardrails for the agent. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
instructionstringOptional. Instructions for the LLM model to guide the agent's behavior.
llmAgentobjectOptional. The default agent type. (id: AgentLlmAgent)
modelSettingsobjectOptional. Configurations for the LLM model. (id: ModelSettings)
remoteDialogflowAgentobjectOptional. 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)
toolsarrayOptional. List of available tools for the agent. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
toolsetsarrayOptional. List of toolsets for the agent.
transferRulesarrayOptional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
updateTimestring (google-datetime)Output only. Timestamp when the agent was last updated.
validationErrorsarrayOutput only. Misconfigurations or errors in the agent that may affect agent quality.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, appsId, agentsIdGets details of the specified agent.
listselectprojectsId, locationsId, appsIdfilter, orderBy, pageSize, pageTokenLists agents in the given app.
createinsertprojectsId, locationsId, appsIdagentIdCreates a new agent in the given app.
patchupdateprojectsId, locationsId, appsId, agentsIdupdateMaskUpdates the specified agent.
deletedeleteprojectsId, locationsId, appsId, agentsIdforce, etagDeletes 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.

NameDatatypeDescription
agentsIdstring
appsIdstring
locationsIdstring
projectsIdstring
agentIdstring
etagstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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 }}'
;