Reference documentation and code samples for the Google Cloud Ces V1 Client class Agent.
An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
Generated from protobuf message google.cloud.ces.v1.Agent
Namespace
Google \ Cloud \ Ces \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ llm_agent
↳ remote_dialogflow_agent
Agent\RemoteDialogflowAgent
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-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com
.
↳ name
string
Identifier. The unique identifier of the agent. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
↳ display_name
string
Required. Display name of the agent.
↳ description
string
Optional. Human-readable description of the agent.
↳ model_settings
↳ instruction
string
Optional. Instructions for the LLM model to guide the agent's behavior.
↳ tools
string[]
Optional. List of available tools for the agent. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
↳ child_agents
string[]
Optional. List of child agents in the agent tree. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
↳ before_agent_callbacks
array< Callback
>
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.
↳ after_agent_callbacks
array< Callback
>
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.
↳ before_model_callbacks
array< Callback
>
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.
↳ after_model_callbacks
array< Callback
>
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.
↳ before_tool_callbacks
array< Callback
>
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.
↳ after_tool_callbacks
array< Callback
>
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.
↳ create_time
↳ update_time
↳ guardrails
string[]
Optional. List of guardrails for the agent. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
↳ 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.
↳ toolsets
↳ generated_summary
string
Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
↳ transfer_rules
array< TransferRule
>
Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
getLlmAgent
Optional. The default agent type.
hasLlmAgent
setLlmAgent
Optional. The default agent type.
$this
getRemoteDialogflowAgent
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-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com
.
hasRemoteDialogflowAgent
setRemoteDialogflowAgent
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-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com
.
$this
getName
Identifier. The unique identifier of the agent.
Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
string
setName
Identifier. The unique identifier of the agent.
Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
var
string
$this
getDisplayName
Required. Display name of the agent.
string
setDisplayName
Required. Display name of the agent.
var
string
$this
getDescription
Optional. Human-readable description of the agent.
string
setDescription
Optional. Human-readable description of the agent.
var
string
$this
getModelSettings
Optional. Configurations for the LLM model.
hasModelSettings
clearModelSettings
setModelSettings
Optional. Configurations for the LLM model.
$this
getInstruction
Optional. Instructions for the LLM model to guide the agent's behavior.
string
setInstruction
Optional. Instructions for the LLM model to guide the agent's behavior.
var
string
$this
getTools
Optional. List of available tools for the agent.
Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
setTools
Optional. List of available tools for the agent.
Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
var
string[]
$this
getChildAgents
Optional. List of child agents in the agent tree.
Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
setChildAgents
Optional. List of child agents in the agent tree.
Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
var
string[]
$this
getBeforeAgentCallbacks
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.
setBeforeAgentCallbacks
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.
$this
getAfterAgentCallbacks
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.
setAfterAgentCallbacks
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.
$this
getBeforeModelCallbacks
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.
setBeforeModelCallbacks
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.
$this
getAfterModelCallbacks
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.
setAfterModelCallbacks
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.
$this
getBeforeToolCallbacks
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.
setBeforeToolCallbacks
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.
$this
getAfterToolCallbacks
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.
setAfterToolCallbacks
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.
$this
getCreateTime
Output only. Timestamp when the agent was created.
hasCreateTime
clearCreateTime
setCreateTime
Output only. Timestamp when the agent was created.
$this
getUpdateTime
Output only. Timestamp when the agent was last updated.
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. Timestamp when the agent was last updated.
$this
getGuardrails
Optional. List of guardrails for the agent.
Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
setGuardrails
Optional. List of guardrails for the agent.
Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
var
string[]
$this
getEtag
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.
string
setEtag
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.
var
string
$this
getToolsets
Optional. List of toolsets for the agent.
setToolsets
Optional. List of toolsets for the agent.
$this
getGeneratedSummary
Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
string
setGeneratedSummary
Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
var
string
$this
getTransferRules
Optional. Agent transfer rules.
If multiple rules match, the first one in the list will be used.
setTransferRules
Optional. Agent transfer rules.
If multiple rules match, the first one in the list will be used.
$this
getAgentType
string

