MCP Tools Reference: ces.googleapis.com

工具:update_agent

更新指定的代理程式。請務必在輸入內容中傳遞更新遮罩。

下列程式碼範例說明如何使用 curl 呼叫 update_agent MCP 工具。

Curl 要求
curl --location 'https://ces.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "update_agent",
    "arguments": {
      // Provide these details according to the MCP tool specification.
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

輸入內容的結構定義

AgentService.UpdateAgent 的要求訊息。

UpdateAgentRequest

JSON 表示法
{
  "agent": {
    object (Agent)
  },
  "updateMask": string
}
欄位
agent

object (Agent)

這是必要旗標,要更新的代理程式。

updateMask

string (FieldMask format)

選用。欄位遮罩用於控管要更新的欄位。如果沒有遮罩,系統會更新所有欄位。

這是以半形逗號分隔的完整欄位名稱清單,範例:"user.displayName,photo"。

代理

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "modelSettings": {
    object (ModelSettings)
  },
  "instruction": string,
  "tools": [
    string
  ],
  "childAgents": [
    string
  ],
  "beforeAgentCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterAgentCallbacks": [
    {
      object (Callback)
    }
  ],
  "beforeModelCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterModelCallbacks": [
    {
      object (Callback)
    }
  ],
  "beforeToolCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterToolCallbacks": [
    {
      object (Callback)
    }
  ],
  "createTime": string,
  "updateTime": string,
  "guardrails": [
    string
  ],
  "etag": string,
  "toolsets": [
    {
      object (AgentToolset)
    }
  ],
  "generatedSummary": string,
  "transferRules": [
    {
      object (TransferRule)
    }
  ],
  "validationErrors": [
    string
  ],

  // Union field agent_type can be only one of the following:
  "llmAgent": {
    object (LlmAgent)
  },
  "remoteDialogflowAgent": {
    object (RemoteDialogflowAgent)
  },
  "remoteA2aAgent": {
    object (RemoteA2aAgent)
  }
  // End of list of possible types for union field agent_type.
}
欄位
name

string

ID。代理程式的專屬 ID。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

displayName

string

這是必要旗標,代理程式的顯示名稱。

description

string

選用。使用者可理解的代理程式說明。

modelSettings

object (ModelSettings)

選用。LLM 模型的設定。

instruction

string

選用。給大型語言模型模型的指令,引導代理的行為。

tools[]

string

選用。代理可用的工具清單。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

childAgents[]

string

選用。代理程式樹狀結構中的子項代理程式清單。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

beforeAgentCallbacks[]

object (Callback)

選用。在呼叫代理程式前執行的回呼。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterAgentCallbacks[]

object (Callback)

選用。呼叫代理程式後要執行的回呼。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

beforeModelCallbacks[]

object (Callback)

選用。在呼叫模型前執行的回呼。如果多次呼叫模型,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterModelCallbacks[]

object (Callback)

選用。模型呼叫後要執行的回呼。如果多次呼叫模型,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

beforeToolCallbacks[]

object (Callback)

選用。在叫用工具前執行的回呼。如果有多個工具呼叫,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterToolCallbacks[]

object (Callback)

選用。工具叫用後要執行的回呼。如果有多個工具呼叫,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

createTime

string (Timestamp format)

僅供輸出。建立代理程式的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

updateTime

string (Timestamp format)

僅供輸出。上次更新代理程式的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

guardrails[]

string

選用。代理的防護措施清單。格式:projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

etag

string

Etag 用於確保物件在讀取 - 修改 - 寫入作業期間未變更。如果 etag 為空,更新作業會覆寫任何並行變更。

toolsets[]

object (AgentToolset)

選用。代理的工具集清單。

generatedSummary

string

僅供輸出。如果代理是由 LLM 助理產生,這個欄位會包含生成作業的描述性摘要。

transferRules[]

object (TransferRule)

選用。代理程式轉移規則。如果有多項規則相符,系統會使用清單中的第一項規則。

validationErrors[]

string

僅供輸出。代理程式設定錯誤或有誤,可能影響代理程式品質。

聯集欄位 agent_type。代理程式類型。agent_type 只能是下列其中一個設定:
llmAgent

object (LlmAgent)

選用。預設代理程式類型。

remoteDialogflowAgent

object (RemoteDialogflowAgent)

選用。用於執行代理的遠端 Dialogflow 代理。如果設定這個欄位,系統會忽略所有其他代理程式層級的屬性。

注意:如果 Dialogflow 代理程式與應用程式位於不同專案,請將 roles/dialogflow.client 授予 CES 服務代理程式 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

remoteA2aAgent

object (RemoteA2aAgent)

選用。用於代理執行的遠端 A2A 代理。

RemoteDialogflowAgent

JSON 表示法
{
  "agent": string,
  "flowId": string,
  "environmentId": string,
  "inputVariableMapping": {
    string: string,
    ...
  },
  "outputVariableMapping": {
    string: string,
    ...
  },
  "respectResponseInterruptionSettings": boolean,
  "languageCodeVariable": string
}
欄位
agent

string

這是必要旗標,Dialogflow 代理資源名稱。格式:projects/{project}/locations/{location}/agents/{agent}

flowId

string

選用。Dialogflow 代理程式中流程的流程 ID。

environmentId

string

選用。用於執行代理程式的 Dialogflow 代理程式環境 ID。如未指定,則會使用草稿環境。

inputVariableMapping

map (key: string, value: string)

選用。將應用程式變數名稱對應至要傳送給 Dialogflow 代理程式做為輸入內容的 Dialogflow 工作階段參數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

outputVariableMapping

map (key: string, value: string)

選用。Dialogflow 工作階段參數名稱與應用程式變數名稱的對應關係,Dialogflow 代理執行完畢後,會將這些名稱傳回 CES 代理。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

respectResponseInterruptionSettings

boolean

選用。指出是否要遵守 Dialogflow 代理程式中設定的訊息層級中斷設定。

  • 如果為 false:Dialogflow 代理程式的所有回應訊息都會遵循應用程式層級的插話設定。
  • 若為 true:只有 allow_playback_interruption 設為 true 的回覆訊息可中斷,所有其他訊息則會遵循應用程式層級的插話設定。
languageCodeVariable

string

選用。變數名稱,其中包含要用於 Dialogflow 會話的語言代碼。如未指定,系統會使用 Dialogflow 代理程式的預設語言代碼。

InputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

OutputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

RemoteA2aAgent

JSON 表示法
{
  "a2aConfig": {
    object (RemoteA2aConfig)
  }
}
欄位
a2aConfig

object (RemoteA2aConfig)

這是必要旗標,A2A 連線設定。

RemoteA2aConfig

JSON 表示法
{
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "inputVariableMapping": {
    string: string,
    ...
  },
  "outputVariableMapping": {
    string: string,
    ...
  },
  "streamingEnabled": boolean,
  "contextId": string,

  // Union field agent_spec can be only one of the following:
  "agentCard": {
    object (AgentCard)
  },
  "agentRegistry": string
  // End of list of possible types for union field agent_spec.
}
欄位
apiAuthentication

object (ApiAuthentication)

選用。呼叫遠端代理程式的驗證設定。如果登錄參照已處理驗證,則為選用。

inputVariableMapping

map (key: string, value: string)

選用。將遠端代理程式的輸入變數名稱對應至 GECX 變數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

outputVariableMapping

map (key: string, value: string)

選用。將遠端代理程式的輸出變數名稱對應至 GECX 變數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

streamingEnabled

boolean

選用。遠端代理程式是否已啟用串流功能。

contextId

string

選用。如果不是空白,與遠端 A2A 代理程式的互動就會使用這個內容 ID。這個 context_id 欄位可以參照工作階段變數,例如 $context.variables.order_agent_session_id。

聯集欄位 agent_spec。遠端代理程式的規格。agent_spec 只能是下列其中一個設定:
agentCard

object (AgentCard)

選用。內嵌定義的完整代理程式資訊卡。

agentRegistry

string

選用。Agent Registry 中的代理參照。格式:projects/{project}/locations/{location}/agents/{agent}

AgentCard

JSON 表示法
{
  "name": string,
  "description": string,
  "supportedInterfaces": [
    {
      object (AgentInterface)
    }
  ],
  "version": string,
  "skills": [
    {
      object (AgentSkill)
    }
  ]
}
欄位
name

string

這是必要旗標,人類可讀的代理名稱。

description

string

這是必要旗標,代理的行動/解決方案空間說明。

supportedInterfaces[]

object (AgentInterface)

這是必要旗標,支援的介面排序清單。系統會優先使用第一個項目。

version

string

這是必要旗標,代理程式的版本。

skills[]

object (AgentSkill)

這是必要旗標,技能代表代理可執行的能力單位。這可能有點抽象,但代表代理程式極有可能成功執行的動作。

AgentInterface

JSON 表示法
{
  "url": string,
  "protocolBinding": string,
  "tenant": string,
  "protocolVersion": string
}
欄位
url

string

這是必要旗標,這個介面的網址。必須是正式環境中有效的絕對 HTTPS 網址。例如:「https://api.example.com/a2a/v1」、「https://grpc.example.com/a2a」

protocolBinding

string

這是必要旗標,這個網址支援的通訊協定繫結。這是開放式表單字串,可輕鬆擴充其他通訊協定繫結。官方支援的核心通訊協定為 JSONRPC、GRPC 和 HTTP+JSON。

tenant

string

呼叫代理程式時,要求中使用的租戶 ID。

protocolVersion

string

這是必要旗標,這個介面公開的 A2A 通訊協定版本。請使用每個主要版本的最新支援子版本。例如:「0.3」、「1.0」

AgentSkill

JSON 表示法
{
  "id": string,
  "name": string,
  "description": string,
  "tags": [
    string
  ],
  "examples": [
    string
  ],
  "inputModes": [
    string
  ],
  "outputModes": [
    string
  ]
}
欄位
id

string

這是必要旗標,代理程式技能的專屬 ID。

name

string

這是必要旗標,使用者可解讀的技能名稱。

description

string

這是必要旗標,技能的詳細說明。

tags[]

string

這是必要旗標,一組描述技能功能的關鍵字。

examples[]

string

這項技能可處理的提示或情境範例。

inputModes[]

string

這項技能支援的輸入媒體類型組合,會覆寫代理程式的預設值。

outputModes[]

string

這項技能支援的輸出媒體類型組合,會覆寫代理程式的預設值。

ApiAuthentication

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "apiKeyConfig": {
    object (ApiKeyConfig)
  },
  "oauthConfig": {
    object (OAuthConfig)
  },
  "serviceAgentIdTokenAuthConfig": {
    object (ServiceAgentIdTokenAuthConfig)
  },
  "serviceAccountAuthConfig": {
    object (ServiceAccountAuthConfig)
  },
  "bearerTokenConfig": {
    object (BearerTokenConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
apiKeyConfig

object (ApiKeyConfig)

選用。API 金鑰驗證的設定。

oauthConfig

object (OAuthConfig)

選用。OAuth 的設定。

serviceAgentIdTokenAuthConfig

object (ServiceAgentIdTokenAuthConfig)

選用。從 CES 服務代理程式產生的 ID 權杖驗證設定。

serviceAccountAuthConfig

object (ServiceAccountAuthConfig)

選用。服務帳戶驗證的設定。

bearerTokenConfig

object (BearerTokenConfig)

選用。不記名權杖驗證的設定。

ApiKeyConfig

JSON 表示法
{
  "keyName": string,
  "apiKeySecretVersion": string,
  "requestLocation": enum (RequestLocation)
}
欄位
keyName

string

這是必要旗標,API 金鑰的參數名稱或標頭名稱。例如:如果 API 要求是「https://example.com/act?X-Api-Key=」,則「X-Api-Key」就是參數名稱。

apiKeySecretVersion

string

這是必要旗標,儲存 API 金鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:請將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

requestLocation

enum (RequestLocation)

這是必要旗標,要求中的金鑰位置。

OAuthConfig

JSON 表示法
{
  "oauthGrantType": enum (OauthGrantType),
  "clientId": string,
  "clientSecretVersion": string,
  "tokenEndpoint": string,
  "scopes": [
    string
  ]
}
欄位
oauthGrantType

enum (OauthGrantType)

這是必要旗標,OAuth 授權類型。

clientId

string

這是必要旗標,OAuth 供應商提供的用戶端 ID。

clientSecretVersion

string

這是必要旗標,儲存用戶端密鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:請將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

tokenEndpoint

string

這是必要旗標,OAuth 供應商的權杖端點,用於交換存取權杖。

scopes[]

string

選用。要授予的 OAuth 範圍。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
欄位
serviceAccount

string

這是必要旗標,用於驗證的服務帳戶電子郵件地址。CES 會使用這個服務帳戶交換存取權杖,然後在要求的 Authorization 標頭中傳送存取權杖。

服務帳戶必須獲派 roles/iam.serviceAccountTokenCreator 角色,才能授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

scopes[]

string

選用。要授予的 OAuth 範圍。如未指定,系統會使用預設範圍 https://www.googleapis.com/auth/cloud-platform。

BearerTokenConfig

JSON 表示法
{
  "token": string
}
欄位
token

string

這是必要旗標,不記名權杖。格式必須為 $context.variables.<name_of_variable>。

InputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

OutputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

ModelSettings

JSON 表示法
{
  "model": string,
  "thinkingLevel": enum (ThinkingLevel),

  // Union field _temperature can be only one of the following:
  "temperature": number
  // End of list of possible types for union field _temperature.
}
欄位
model

string

選用。代理程式應使用的 LLM 模型。如未設定,代理程式會沿用上層代理程式的模型。

thinkingLevel

enum (ThinkingLevel)

選用。模型的思考程度。

聯集欄位 _temperature。

_temperature 只能是下列之一:

temperature

number

選用。如果設定了這個值,系統就會將其用於 LLM 模型。溫度參數會決定模型回覆的隨機程度。溫度越低,生成的回覆就越容易預測。溫度越高,生成的回覆就越有創意。

回撥電話

JSON 表示法
{
  "description": string,
  "disabled": boolean,
  "proactiveExecutionEnabled": boolean,

  // Union field callback can be only one of the following:
  "pythonCode": string
  // End of list of possible types for union field callback.
}
欄位
description

string

選用。使用者可理解的回呼說明。

disabled

boolean

選用。回呼是否已停用。代理程式會忽略已停用的回呼。

proactiveExecutionEnabled

boolean

選用。如果啟用這項功能,系統也會對中繼模型輸出內容執行回呼。這項設定只會影響模型回呼後續作業。請謹慎啟用。通常在收到所有模型回覆後,才需要執行模型回呼。啟用主動執行功能可能會對執行成本和延遲時間造成負面影響,因此只應在極少數情況下啟用。

聯集欄位 callback。要執行的回呼。callback 只能是下列其中一個設定:
pythonCode

string

這是必要旗標,要為回呼執行的 Python 程式碼。

時間戳記

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

代表自 Unix 紀元 1970-01-01T00:00:00Z 起算的世界標準時間秒數。必須介於 -62135596800 和 253402300799 之間 (含),對應的時間範圍為 0001-01-01T00:00:00Z 至 9999-12-31T23:59:59Z。

nanos

integer

以奈秒為單位的非負秒數小數。這個欄位是時間長度的奈秒部分,並非秒數的替代值。如果秒數值為負數,且包含小數,奈秒值仍須為非負數,且會往前計算時間。必須介於 0 至 999,999,999 之間 (含)。

AgentToolset

JSON 表示法
{
  "toolset": string,
  "toolIds": [
    string
  ]
}
欄位
toolset

string

這是必要旗標,工具集的資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

toolIds[]

string

選用。用於篩選工具集的工具 ID。

TransferRule

JSON 表示法
{
  "childAgent": string,
  "direction": enum (Direction),

  // Union field rule_type can be only one of the following:
  "deterministicTransfer": {
    object (DeterministicTransfer)
  },
  "disablePlannerTransfer": {
    object (DisablePlannerTransfer)
  }
  // End of list of possible types for union field rule_type.
}
欄位
childAgent

string

這是必要旗標,規則適用的子項代理程式資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

direction

enum (Direction)

這是必要旗標,轉移方向。

聯集欄位 rule_type。規則類型。rule_type 只能是下列其中一個設定:
deterministicTransfer

object (DeterministicTransfer)

選用。規則:符合條件時立即轉移給目標服務專員。

disablePlannerTransfer

object (DisablePlannerTransfer)

選用。這項規則會禁止規劃師轉移給目標服務專員。

DeterministicTransfer

JSON 表示法
{

  // Union field condition_type can be only one of the following:
  "expressionCondition": {
    object (ExpressionCondition)
  },
  "pythonCodeCondition": {
    object (PythonCodeCondition)
  }
  // End of list of possible types for union field condition_type.
}
欄位
聯集欄位 condition_type。要評估的條件。condition_type 只能是下列其中一個設定:
expressionCondition

object (ExpressionCondition)

選用。評估工作階段狀態條件的規則。如果條件評估結果為 true,就會進行轉移。

pythonCodeCondition

object (PythonCodeCondition)

選用。使用 Python 程式碼區塊評估條件的規則。如果條件評估結果為 true,就會進行轉移。

ExpressionCondition

JSON 表示法
{
  "expression": string
}
欄位
expression

string

這是必要旗標,cloud.api.Expression 條件的字串表示法。

PythonCodeCondition

JSON 表示法
{
  "pythonCode": string
}
欄位
pythonCode

string

這是必要旗標,要執行的 Python 程式碼。

DisablePlannerTransfer

JSON 表示法
{
  "expressionCondition": {
    object (ExpressionCondition)
  }
}
欄位
expressionCondition

object (ExpressionCondition)

這是必要旗標,如果條件評估結果為 true,規劃人員就無法轉移至目標代理。

FieldMask

JSON 表示法
{
  "paths": [
    string
  ]
}
欄位
paths[]

string

一組欄位遮罩路徑。

RequestLocation

要求中 API 金鑰的位置。

列舉
REQUEST_LOCATION_UNSPECIFIED 不明。請勿使用這個值。
HEADER 代表 HTTP 標頭中的金鑰。
QUERY_STRING 代表查詢字串中的鍵。

OauthGrantType

OAuth 授權類型。系統僅支援用戶端憑證授權。

列舉
OAUTH_GRANT_TYPE_UNSPECIFIED 不明。預設值為 CLIENT_CREDENTIAL。
CLIENT_CREDENTIAL 代表用戶端憑證流程。

ThinkingLevel

模型的思考程度設定。

列舉
THINKING_LEVEL_UNSPECIFIED 未指定思考程度。
DEFAULT 預設思考程度。
LOW 思考程度較低。
MEDIUM 中度思考程度。
HIGH 深度思考程度。

方向

轉移方向。

列舉
DIRECTION_UNSPECIFIED 未指定方向。
PARENT_TO_CHILD 從父項代理轉移至子項代理。
CHILD_TO_PARENT 從子代理轉移至上層代理。

輸出內容的結構定義

代理程式是提供指令給大型語言模型 (LLM) 以執行特定工作的基本構成元素。

代理

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "modelSettings": {
    object (ModelSettings)
  },
  "instruction": string,
  "tools": [
    string
  ],
  "childAgents": [
    string
  ],
  "beforeAgentCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterAgentCallbacks": [
    {
      object (Callback)
    }
  ],
  "beforeModelCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterModelCallbacks": [
    {
      object (Callback)
    }
  ],
  "beforeToolCallbacks": [
    {
      object (Callback)
    }
  ],
  "afterToolCallbacks": [
    {
      object (Callback)
    }
  ],
  "createTime": string,
  "updateTime": string,
  "guardrails": [
    string
  ],
  "etag": string,
  "toolsets": [
    {
      object (AgentToolset)
    }
  ],
  "generatedSummary": string,
  "transferRules": [
    {
      object (TransferRule)
    }
  ],
  "validationErrors": [
    string
  ],

  // Union field agent_type can be only one of the following:
  "llmAgent": {
    object (LlmAgent)
  },
  "remoteDialogflowAgent": {
    object (RemoteDialogflowAgent)
  },
  "remoteA2aAgent": {
    object (RemoteA2aAgent)
  }
  // End of list of possible types for union field agent_type.
}
欄位
name

string

ID。代理程式的專屬 ID。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

displayName

string

這是必要旗標,代理程式的顯示名稱。

description

string

選用。使用者可理解的代理程式說明。

modelSettings

object (ModelSettings)

選用。LLM 模型的設定。

instruction

string

選用。給大型語言模型模型的指令,引導代理的行為。

tools[]

string

選用。代理可用的工具清單。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

childAgents[]

string

選用。代理程式樹狀結構中的子項代理程式清單。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

beforeAgentCallbacks[]

object (Callback)

選用。在呼叫代理程式前執行的回呼。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterAgentCallbacks[]

object (Callback)

選用。呼叫代理程式後要執行的回呼。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

beforeModelCallbacks[]

object (Callback)

選用。在呼叫模型前執行的回呼。如果多次呼叫模型,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterModelCallbacks[]

object (Callback)

選用。模型呼叫後要執行的回呼。如果多次呼叫模型,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

beforeToolCallbacks[]

object (Callback)

選用。在叫用工具前執行的回呼。如果有多個工具呼叫,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

afterToolCallbacks[]

object (Callback)

選用。工具叫用後要執行的回呼。如果有多個工具呼叫,回呼就會執行多次。系統會按照清單中的順序,依序執行提供的回呼。如果回呼傳回覆寫的回應,執行作業就會停止,並略過所有其餘回呼。

createTime

string (Timestamp format)

僅供輸出。建立代理程式的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

updateTime

string (Timestamp format)

僅供輸出。上次更新代理程式的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

guardrails[]

string

選用。代理的防護措施清單。格式:projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

etag

string

Etag 用於確保物件在讀取 - 修改 - 寫入作業期間未變更。如果 etag 為空,更新作業會覆寫任何並行變更。

toolsets[]

object (AgentToolset)

選用。代理的工具集清單。

generatedSummary

string

僅供輸出。如果代理是由 LLM 助理產生,這個欄位會包含生成作業的描述性摘要。

transferRules[]

object (TransferRule)

選用。代理程式轉移規則。如果有多項規則相符,系統會使用清單中的第一項規則。

validationErrors[]

string

僅供輸出。代理程式設定錯誤或有誤,可能影響代理程式品質。

聯集欄位 agent_type。代理程式類型。agent_type 只能是下列其中一個設定:
llmAgent

object (LlmAgent)

選用。預設代理程式類型。

remoteDialogflowAgent

object (RemoteDialogflowAgent)

選用。用於執行代理的遠端 Dialogflow 代理。如果設定這個欄位,系統會忽略所有其他代理程式層級的屬性。

注意:如果 Dialogflow 代理程式與應用程式位於不同專案,請將 roles/dialogflow.client 授予 CES 服務代理程式 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

remoteA2aAgent

object (RemoteA2aAgent)

選用。用於代理執行的遠端 A2A 代理。

RemoteDialogflowAgent

JSON 表示法
{
  "agent": string,
  "flowId": string,
  "environmentId": string,
  "inputVariableMapping": {
    string: string,
    ...
  },
  "outputVariableMapping": {
    string: string,
    ...
  },
  "respectResponseInterruptionSettings": boolean,
  "languageCodeVariable": string
}
欄位
agent

string

這是必要旗標,Dialogflow 代理資源名稱。格式:projects/{project}/locations/{location}/agents/{agent}

flowId

string

選用。Dialogflow 代理程式中流程的流程 ID。

environmentId

string

選用。用於執行代理程式的 Dialogflow 代理程式環境 ID。如未指定,則會使用草稿環境。

inputVariableMapping

map (key: string, value: string)

選用。將應用程式變數名稱對應至要傳送給 Dialogflow 代理程式做為輸入內容的 Dialogflow 工作階段參數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

outputVariableMapping

map (key: string, value: string)

選用。Dialogflow 工作階段參數名稱與應用程式變數名稱的對應關係,Dialogflow 代理執行完畢後,會將這些名稱傳回 CES 代理。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

respectResponseInterruptionSettings

boolean

選用。指出是否要遵守 Dialogflow 代理程式中設定的訊息層級中斷設定。

  • 如果為 false:Dialogflow 代理程式的所有回應訊息都會遵循應用程式層級的插話設定。
  • 若為 true:只有 allow_playback_interruption 設為 true 的回覆訊息可中斷,所有其他訊息則會遵循應用程式層級的插話設定。
languageCodeVariable

string

選用。變數名稱,其中包含要用於 Dialogflow 會話的語言代碼。如未指定,系統會使用 Dialogflow 代理程式的預設語言代碼。

InputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

OutputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

RemoteA2aAgent

JSON 表示法
{
  "a2aConfig": {
    object (RemoteA2aConfig)
  }
}
欄位
a2aConfig

object (RemoteA2aConfig)

這是必要旗標,A2A 連線設定。

RemoteA2aConfig

JSON 表示法
{
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "inputVariableMapping": {
    string: string,
    ...
  },
  "outputVariableMapping": {
    string: string,
    ...
  },
  "streamingEnabled": boolean,
  "contextId": string,

  // Union field agent_spec can be only one of the following:
  "agentCard": {
    object (AgentCard)
  },
  "agentRegistry": string
  // End of list of possible types for union field agent_spec.
}
欄位
apiAuthentication

object (ApiAuthentication)

選用。呼叫遠端代理程式的驗證設定。如果登錄參照已處理驗證,則為選用。

inputVariableMapping

map (key: string, value: string)

選用。將遠端代理程式的輸入變數名稱對應至 GECX 變數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

outputVariableMapping

map (key: string, value: string)

選用。將遠端代理程式的輸出變數名稱對應至 GECX 變數名稱。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

streamingEnabled

boolean

選用。遠端代理程式是否已啟用串流功能。

contextId

string

選用。如果不是空白,與遠端 A2A 代理程式的互動就會使用這個內容 ID。這個 context_id 欄位可以參照工作階段變數,例如 $context.variables.order_agent_session_id。

聯集欄位 agent_spec。遠端代理程式的規格。agent_spec 只能是下列其中一個設定:
agentCard

object (AgentCard)

選用。內嵌定義的完整代理程式資訊卡。

agentRegistry

string

選用。Agent Registry 中的代理參照。格式:projects/{project}/locations/{location}/agents/{agent}

AgentCard

JSON 表示法
{
  "name": string,
  "description": string,
  "supportedInterfaces": [
    {
      object (AgentInterface)
    }
  ],
  "version": string,
  "skills": [
    {
      object (AgentSkill)
    }
  ]
}
欄位
name

string

這是必要旗標,人類可讀的代理名稱。

description

string

這是必要旗標,代理的行動/解決方案空間說明。

supportedInterfaces[]

object (AgentInterface)

這是必要旗標,支援的介面排序清單。系統會優先使用第一個項目。

version

string

這是必要旗標,代理程式的版本。

skills[]

object (AgentSkill)

這是必要旗標,技能代表代理可執行的能力單位。這可能有點抽象,但代表代理程式極有可能成功執行的動作。

AgentInterface

JSON 表示法
{
  "url": string,
  "protocolBinding": string,
  "tenant": string,
  "protocolVersion": string
}
欄位
url

string

這是必要旗標,這個介面的網址。必須是正式環境中有效的絕對 HTTPS 網址。例如:「https://api.example.com/a2a/v1」、「https://grpc.example.com/a2a」

protocolBinding

string

這是必要旗標,這個網址支援的通訊協定繫結。這是開放式表單字串,可輕鬆擴充其他通訊協定繫結。官方支援的核心通訊協定為 JSONRPC、GRPC 和 HTTP+JSON。

tenant

string

呼叫代理程式時,要求中使用的租戶 ID。

protocolVersion

string

這是必要旗標,這個介面公開的 A2A 通訊協定版本。請使用每個主要版本的最新支援子版本。例如:「0.3」、「1.0」

AgentSkill

JSON 表示法
{
  "id": string,
  "name": string,
  "description": string,
  "tags": [
    string
  ],
  "examples": [
    string
  ],
  "inputModes": [
    string
  ],
  "outputModes": [
    string
  ]
}
欄位
id

string

這是必要旗標,代理程式技能的專屬 ID。

name

string

這是必要旗標,使用者可解讀的技能名稱。

description

string

這是必要旗標,技能的詳細說明。

tags[]

string

這是必要旗標,一組描述技能功能的關鍵字。

examples[]

string

這項技能可處理的提示或情境範例。

inputModes[]

string

這項技能支援的輸入媒體類型組合,會覆寫代理程式的預設值。

outputModes[]

string

這項技能支援的輸出媒體類型組合,會覆寫代理程式的預設值。

ApiAuthentication

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "apiKeyConfig": {
    object (ApiKeyConfig)
  },
  "oauthConfig": {
    object (OAuthConfig)
  },
  "serviceAgentIdTokenAuthConfig": {
    object (ServiceAgentIdTokenAuthConfig)
  },
  "serviceAccountAuthConfig": {
    object (ServiceAccountAuthConfig)
  },
  "bearerTokenConfig": {
    object (BearerTokenConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
apiKeyConfig

object (ApiKeyConfig)

選用。API 金鑰驗證的設定。

oauthConfig

object (OAuthConfig)

選用。OAuth 的設定。

serviceAgentIdTokenAuthConfig

object (ServiceAgentIdTokenAuthConfig)

選用。從 CES 服務代理程式產生的 ID 權杖驗證設定。

serviceAccountAuthConfig

object (ServiceAccountAuthConfig)

選用。服務帳戶驗證的設定。

bearerTokenConfig

object (BearerTokenConfig)

選用。不記名權杖驗證的設定。

ApiKeyConfig

JSON 表示法
{
  "keyName": string,
  "apiKeySecretVersion": string,
  "requestLocation": enum (RequestLocation)
}
欄位
keyName

string

這是必要旗標,API 金鑰的參數名稱或標頭名稱。例如:如果 API 要求是「https://example.com/act?X-Api-Key=」,則「X-Api-Key」就是參數名稱。

apiKeySecretVersion

string

這是必要旗標,儲存 API 金鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:請將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

requestLocation

enum (RequestLocation)

這是必要旗標,要求中的金鑰位置。

OAuthConfig

JSON 表示法
{
  "oauthGrantType": enum (OauthGrantType),
  "clientId": string,
  "clientSecretVersion": string,
  "tokenEndpoint": string,
  "scopes": [
    string
  ]
}
欄位
oauthGrantType

enum (OauthGrantType)

這是必要旗標,OAuth 授權類型。

clientId

string

這是必要旗標,OAuth 供應商提供的用戶端 ID。

clientSecretVersion

string

這是必要旗標,儲存用戶端密鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:請將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

tokenEndpoint

string

這是必要旗標,OAuth 供應商的權杖端點,用於交換存取權杖。

scopes[]

string

選用。要授予的 OAuth 範圍。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
欄位
serviceAccount

string

這是必要旗標,用於驗證的服務帳戶電子郵件地址。CES 會使用這個服務帳戶交換存取權杖,然後在要求的 Authorization 標頭中傳送存取權杖。

服務帳戶必須獲派 roles/iam.serviceAccountTokenCreator 角色,才能授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com。

scopes[]

string

選用。要授予的 OAuth 範圍。如未指定,系統會使用預設範圍 https://www.googleapis.com/auth/cloud-platform。

BearerTokenConfig

JSON 表示法
{
  "token": string
}
欄位
token

string

這是必要旗標,不記名權杖。格式必須為 $context.variables.<name_of_variable>。

InputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

OutputVariableMappingEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

ModelSettings

JSON 表示法
{
  "model": string,
  "thinkingLevel": enum (ThinkingLevel),

  // Union field _temperature can be only one of the following:
  "temperature": number
  // End of list of possible types for union field _temperature.
}
欄位
model

string

選用。代理程式應使用的 LLM 模型。如未設定,代理程式會沿用上層代理程式的模型。

thinkingLevel

enum (ThinkingLevel)

選用。模型的思考程度。

聯集欄位 _temperature。

_temperature 只能是下列之一:

temperature

number

選用。如果設定了這個值,系統就會將其用於 LLM 模型。溫度參數會決定模型回覆的隨機程度。溫度越低,生成的回覆就越容易預測。溫度越高,生成的回覆就越有創意。

回撥電話

JSON 表示法
{
  "description": string,
  "disabled": boolean,
  "proactiveExecutionEnabled": boolean,

  // Union field callback can be only one of the following:
  "pythonCode": string
  // End of list of possible types for union field callback.
}
欄位
description

string

選用。使用者可理解的回呼說明。

disabled

boolean

選用。回呼是否已停用。代理程式會忽略已停用的回呼。

proactiveExecutionEnabled

boolean

選用。如果啟用這項功能,系統也會對中繼模型輸出內容執行回呼。這項設定只會影響模型回呼後續作業。請謹慎啟用。通常在收到所有模型回覆後,才需要執行模型回呼。啟用主動執行功能可能會對執行成本和延遲時間造成負面影響,因此只應在極少數情況下啟用。

聯集欄位 callback。要執行的回呼。callback 只能是下列其中一個設定:
pythonCode

string

這是必要旗標,要為回呼執行的 Python 程式碼。

時間戳記

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

代表自 Unix 紀元 1970-01-01T00:00:00Z 起算的世界標準時間秒數。必須介於 -62135596800 和 253402300799 之間 (含),對應的時間範圍為 0001-01-01T00:00:00Z 至 9999-12-31T23:59:59Z。

nanos

integer

以奈秒為單位的非負秒數小數。這個欄位是時間長度的奈秒部分,並非秒數的替代值。如果秒數值為負數,且包含小數,奈秒值仍須為非負數,且會往前計算時間。必須介於 0 至 999,999,999 之間 (含)。

AgentToolset

JSON 表示法
{
  "toolset": string,
  "toolIds": [
    string
  ]
}
欄位
toolset

string

這是必要旗標,工具集的資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

toolIds[]

string

選用。用於篩選工具集的工具 ID。

TransferRule

JSON 表示法
{
  "childAgent": string,
  "direction": enum (Direction),

  // Union field rule_type can be only one of the following:
  "deterministicTransfer": {
    object (DeterministicTransfer)
  },
  "disablePlannerTransfer": {
    object (DisablePlannerTransfer)
  }
  // End of list of possible types for union field rule_type.
}
欄位
childAgent

string

這是必要旗標,規則適用的子項代理程式資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

direction

enum (Direction)

這是必要旗標,轉移方向。

聯集欄位 rule_type。規則類型。rule_type 只能是下列其中一個設定:
deterministicTransfer

object (DeterministicTransfer)

選用。規則:符合條件時立即轉移給目標服務專員。

disablePlannerTransfer

object (DisablePlannerTransfer)

選用。這項規則會禁止規劃師轉移給目標服務專員。

DeterministicTransfer

JSON 表示法
{

  // Union field condition_type can be only one of the following:
  "expressionCondition": {
    object (ExpressionCondition)
  },
  "pythonCodeCondition": {
    object (PythonCodeCondition)
  }
  // End of list of possible types for union field condition_type.
}
欄位
聯集欄位 condition_type。要評估的條件。condition_type 只能是下列其中一個設定:
expressionCondition

object (ExpressionCondition)

選用。評估工作階段狀態條件的規則。如果條件評估結果為 true,就會進行轉移。

pythonCodeCondition

object (PythonCodeCondition)

選用。使用 Python 程式碼區塊評估條件的規則。如果條件評估結果為 true,就會進行轉移。

ExpressionCondition

JSON 表示法
{
  "expression": string
}
欄位
expression

string

這是必要旗標,cloud.api.Expression 條件的字串表示法。

PythonCodeCondition

JSON 表示法
{
  "pythonCode": string
}
欄位
pythonCode

string

這是必要旗標,要執行的 Python 程式碼。

DisablePlannerTransfer

JSON 表示法
{
  "expressionCondition": {
    object (ExpressionCondition)
  }
}
欄位
expressionCondition

object (ExpressionCondition)

這是必要旗標,如果條件評估結果為 true,規劃人員就無法轉移至目標代理。

RequestLocation

要求中 API 金鑰的位置。

列舉
REQUEST_LOCATION_UNSPECIFIED 不明。請勿使用這個值。
HEADER 代表 HTTP 標頭中的金鑰。
QUERY_STRING 代表查詢字串中的鍵。

OauthGrantType

OAuth 授權類型。系統僅支援用戶端憑證授權。

列舉
OAUTH_GRANT_TYPE_UNSPECIFIED 不明。預設值為 CLIENT_CREDENTIAL。
CLIENT_CREDENTIAL 代表用戶端憑證流程。

ThinkingLevel

模型的思考程度設定。

列舉
THINKING_LEVEL_UNSPECIFIED 未指定思考程度。
DEFAULT 預設思考程度。
LOW 思考程度較低。
MEDIUM 中度思考程度。
HIGH 深度思考程度。

方向

轉移方向。

列舉
DIRECTION_UNSPECIFIED 未指定方向。
PARENT_TO_CHILD 從父項代理轉移至子項代理。
CHILD_TO_PARENT 從子代理轉移至上層代理。

工具註解

工具註解會傳送至 MCP 用戶端,說明特定工具的基本風險。大多數用戶端會將這些提示視為不受信任,但可用於決定何時可能向使用者傳送確認提示。

除了標題字串,以下布林值提示的定義如下:

  • readOnlyHint:如果為 true,工具不會修改環境。預設值為 false。
  • destructiveHint:如果為 true,工具可以執行破壞性動作。如果為 false,工具只能執行加法動作。預設值:true。
  • idempotentHint:如果為 true,以相同引數重複呼叫工具時,不會對環境產生額外影響。預設值為 false。
  • openWorldHint:設為 true 時,工具可與外部實體的「開放世界」互動。如果為 false,工具只能與內部實體互動。舉例來說,網路搜尋工具屬於開放世界,記憶體工具則不屬於開放世界。

破壞性提示:✅ | 等冪提示:❌ | 唯讀提示:❌ | 開放世界提示:❌