MCP Tools Reference: ces.googleapis.com

工具:get_tool

获取指定工具的详细信息。

以下示例演示了如何使用 curl 调用 get_tool MCP 工具。

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

输入架构

AgentService.GetTool 的请求消息。

GetToolRequest

JSON 表示法
{
  "name": string
}
字段
name

string

必需。要检索的工具的资源名称。

输出架构

工具表示 CES 代理可以采取的行动,以实现特定目标。

工具

JSON 表示法
{
  "name": string,
  "displayName": string,
  "executionType": enum (ExecutionType),
  "createTime": string,
  "updateTime": string,
  "etag": string,
  "generatedSummary": string,
  "toolFakeConfig": {
    object (ToolFakeConfig)
  },

  // Union field tool_type can be only one of the following:
  "clientFunction": {
    object (ClientFunction)
  },
  "openApiTool": {
    object (OpenApiTool)
  },
  "googleSearchTool": {
    object (GoogleSearchTool)
  },
  "connectorTool": {
    object (ConnectorTool)
  },
  "dataStoreTool": {
    object (DataStoreTool)
  },
  "pythonFunction": {
    object (PythonFunction)
  },
  "mcpTool": {
    object (McpTool)
  },
  "fileSearchTool": {
    object (FileSearchTool)
  },
  "systemTool": {
    object (SystemTool)
  },
  "widgetTool": {
    object (WidgetTool)
  }
  // End of list of possible types for union field tool_type.
}
字段
name

string

标识符。工具的唯一标识符。格式:- projects/{project}/locations/{location}/apps/{app}/tools/{tool}(适用于

从工具集中检索到的工具的 projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}。这些工具是动态的,并且只能输出,无法在需要工具的地方直接引用。

displayName

string

仅限输出。工具的显示名称,根据工具的类型派生。例如,[ClientFunction][Tool.ClientFunction] 的显示名称派生自其 name 属性。

executionType

enum (ExecutionType)

可选。工具的执行类型。

createTime

string (Timestamp format)

仅限输出。工具创建时的时间戳。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 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 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

etag

string

用于确保对象在读取-修改-写入操作期间未发生更改的 ETag。如果 etag 为空,则更新会覆盖任何并发更改。

generatedSummary

string

仅限输出。如果该工具是由 LLM 助理生成的,则此字段包含生成内容的描述性摘要。

toolFakeConfig

object (ToolFakeConfig)

可选。伪造模式下的工具行为配置。

联合字段 tool_type。工具的类型。tool_type 只能是下列其中一项:
clientFunction

object (ClientFunction)

可选。客户端函数。

openApiTool

object (OpenApiTool)

可选。开放式 API 工具。

googleSearchTool

object (GoogleSearchTool)

可选。Google 搜索工具。

connectorTool

object (ConnectorTool)

可选。Integration Connector 工具。

dataStoreTool

object (DataStoreTool)

可选。数据存储区工具。

pythonFunction

object (PythonFunction)

可选。Python 函数工具。

mcpTool

object (McpTool)

可选。MCP 工具。MCP 工具无法直接创建或更新,而是由 MCP 工具集管理。

fileSearchTool

object (FileSearchTool)

可选。文件搜索工具。

systemTool

object (SystemTool)

可选。系统工具。

widgetTool

object (WidgetTool)

可选。微件工具。

ClientFunction

JSON 表示法
{
  "name": string,
  "description": string,
  "parameters": {
    object (Schema)
  },
  "response": {
    object (Schema)
  }
}
字段
name

string

必需。函数名称。

description

string

可选。函数说明。

parameters

object (Schema)

可选。函数参数的架构。

response

object (Schema)

可选。函数响应的架构。

架构

JSON 表示法
{
  "type": enum (Type),
  "properties": {
    string: {
      object (Schema)
    },
    ...
  },
  "required": [
    string
  ],
  "description": string,
  "items": {
    object (Schema)
  },
  "nullable": boolean,
  "uniqueItems": boolean,
  "prefixItems": [
    {
      object (Schema)
    }
  ],
  "additionalProperties": {
    object (Schema)
  },
  "anyOf": [
    {
      object (Schema)
    }
  ],
  "enum": [
    string
  ],
  "default": value,
  "ref": string,
  "defs": {
    string: {
      object (Schema)
    },
    ...
  },
  "title": string,
  "minItems": string,
  "maxItems": string,

  // Union field _minimum can be only one of the following:
  "minimum": number
  // End of list of possible types for union field _minimum.

  // Union field _maximum can be only one of the following:
  "maximum": number
  // End of list of possible types for union field _maximum.
}
字段
type

enum (Type)

必需。数据类型。

properties

map (key: string, value: object (Schema))

可选。Type.OBJECT 的属性。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

required[]

string

可选。Type.OBJECT 的必需属性。

description

string

可选。数据的说明。

items

object (Schema)

可选。Type.ARRAY 的元素的架构。

nullable

boolean

可选。指示值是否为 null。

uniqueItems

boolean

可选。表示数组中的项必须是唯一的。仅适用于 TYPE.ARRAY。

prefixItems[]

object (Schema)

可选。Type.ARRAY 的初始元素的架构。

additionalProperties

object (Schema)

可选。可以是布尔值或对象,用于控制是否存在其他属性。

anyOf[]

object (Schema)

可选。该值应根据列表中的任何(一个或多个)子架构进行验证。

enum[]

string

可选。原始类型的元素可能的具有枚举格式的值。示例:1. 我们可以将方向定义为:{type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. 我们可以将公寓号定义为:{type:INTEGER, format:enum, enum:["101", "201", "301"]}

default

value (Value format)

可选。数据的默认值。

ref

string

可选。允许在架构节点之间进行间接引用。该值应该是对根 defs 的子元素的有效引用。

例如,以下架构定义了对名为“Pet”的架构节点的引用:

type: object
properties:
  pet:
    ref: #/defs/Pet
defs:
  Pet:
    type: object
    properties:
      name:
        type: string

“pet”属性的值是对名为“Pet”的架构节点的引用。如需了解详情,请参阅 https://json-schema.org/understanding-json-schema/structuring

defs

map (key: string, value: object (Schema))

可选。供 ref 使用的定义映射。仅允许在架构的根级使用。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

title

string

可选。架构的标题。

minItems

string (int64 format)

可选。Type.ARRAY 的元素数量下限。

maxItems

string (int64 format)

可选。Type.ARRAY 的元素数量上限。

联合字段 _minimum

_minimum 只能是下列其中一项:

minimum

number

可选。Type.INTEGER 和 Type.NUMBER 的最小值。

联合字段 _maximum

_maximum 只能是下列其中一项:

maximum

number

可选。Type.INTEGER 和 Type.NUMBER 的最大值。

PropertiesEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
字段
key

string

value

object (Schema)

JSON 表示法
{

  // Union field kind can be only one of the following:
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
  // End of list of possible types for union field kind.
}
字段
联合字段 kind。值的类型。kind 只能是下列其中一项:
nullValue

null

表示 null 值。

numberValue

number

表示双精度值。

stringValue

string

表示字符串值。

boolValue

boolean

表示布尔值。

structValue

object (Struct format)

表示结构化值。

listValue

array (ListValue format)

表示重复的 Value

结构体

JSON 表示法
{
  "fields": {
    string: value,
    ...
  }
}
字段
fields

map (key: string, value: value (Value format))

无序的动态类型值映射。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

FieldsEntry

JSON 表示法
{
  "key": string,
  "value": value
}
字段
key

string

value

value (Value format)

ListValue

JSON 表示法
{
  "values": [
    value
  ]
}
字段
values[]

value (Value format)

动态类型值的重复字段。

DefsEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
字段
key

string

value

object (Schema)

OpenApiTool

JSON 表示法
{
  "openApiSchema": string,
  "name": string,
  "description": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "ignoreUnknownFields": boolean,
  "url": string
}
字段
openApiSchema

string

必需。JSON 或 YAML 格式的 OpenAPI 架构。

name

string

可选。工具的名称。如果未提供,工具的名称将从 OpenAPI 架构的 operation.operationId 中派生出来。

description

string

可选。工具的说明。如果未提供,工具的说明将从 OpenAPI 架构(operation.descriptionoperation.summary)中派生。

apiAuthentication

object (ApiAuthentication)

可选。API 所需的身份验证信息。

tlsConfig

object (TlsConfig)

可选。TLS 配置。包含客户端将信任的自定义服务器证书。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

可选。Service Directory 配置。

ignoreUnknownFields

boolean

可选。如果为 true,代理将忽略 API 响应中的未知字段。

url

string

可选。Open API 架构的服务器网址。仅当架构包含服务器网址时,此字段才会在导出过程中设置到环境依赖项中的工具中。在导入过程中,如果此网址存在于环境依赖项中,并且架构具有 $env_var 占位符,则该网址将替换架构中的占位符。

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 Secret 版本资源的名称。格式:projects/{project}/secrets/{secret}/versions/{version}

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

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}

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

tokenEndpoint

string

必需。OAuth 提供方中用于换取访问令牌的令牌端点。

scopes[]

string

可选。要授予的 OAuth 范围。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
字段
serviceAccount

string

必需。用于身份验证的服务账号的电子邮件地址。CES 使用此服务账号来交换访问令牌,然后在请求的 Authorization 标头中发送该访问令牌。

服务账号必须拥有授予 CES 服务代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.comroles/iam.serviceAccountTokenCreator 角色。

scopes[]

string

可选。要授予的 OAuth 范围。如果未指定,则使用默认范围 https://www.googleapis.com/auth/cloud-platform

BearerTokenConfig

JSON 表示法
{
  "token": string
}
字段
token

string

必需。不记名令牌。必须采用 $context.variables.<name_of_variable> 格式。

TlsConfig

JSON 表示法
{
  "caCerts": [
    {
      object (CaCert)
    }
  ]
}
字段
caCerts[]

object (CaCert)

必需。指定用于 HTTPS 验证的允许的自定义 CA 证书列表。

CaCert

JSON 表示法
{
  "displayName": string,
  "cert": string
}
字段
displayName

string

必需。允许使用的自定义 CA 证书的名称。这可用于消除自定义 CA 证书的歧义。

cert

string (bytes format)

必需。用于 HTTPS 验证的允许的自定义 CA 证书(采用 DER 格式)。此设置会替换默认的 SSL 信任库。如果此字段为空或未指定,CES 将使用 Google 的默认信任库来验证证书。注意:请确保 HTTPS 服务器证书使用“subject alt name”进行签名。例如,可以使用以下命令自签名证书:openssl x509 -req -days 200 -in example.com.csr \ -signkey example.com.key \ -out example.com.crt \ -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")

使用 base64 编码的字符串。

ServiceDirectoryConfig

JSON 表示法
{
  "service": string
}
字段
service

string

必需。Service Directory 服务的名称。格式:projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}。服务目录的位置必须与应用的位置相同。

GoogleSearchTool

JSON 表示法
{
  "name": string,
  "description": string,
  "contextUrls": [
    string
  ],
  "preferredDomains": [
    string
  ],
  "excludeDomains": [
    string
  ],
  "promptConfig": {
    object (PromptConfig)
  }
}
字段
name

string

必需。工具的名称。

description

string

可选。工具用途的说明。

contextUrls[]

string

可选。系统会直接从这些网址提取内容,以用于上下文和接地。示例:“https://example.com/path.html”。最多允许添加 20 个网址。

preferredDomains[]

string

可选。指定要将搜索结果限制在哪些网域中。示例:“example.com”“another.site”。最多可以指定 20 个网域。

excludeDomains[]

string

可选。要从搜索结果中排除的网域列表。示例:“example.com”。最多可排除 2,000 个网域。

promptConfig

object (PromptConfig)

可选。传递给规划器的提示指令,用于说明应如何处理文本和语音搜索结果。

PromptConfig

JSON 表示法
{
  "textPrompt": string,
  "voicePrompt": string
}
字段
textPrompt

string

可选。定义在聊天对话中与代理互动时用于系统指令的提示。如果未设置,系统将使用默认提示。

voicePrompt

string

可选。定义在语音对话中与代理互动时用于系统指令的提示。如果未设置,系统将使用默认提示。

ConnectorTool

JSON 表示法
{
  "connection": string,
  "action": {
    object (Action)
  },
  "authConfig": {
    object (EndUserAuthConfig)
  },
  "name": string,
  "description": string
}
字段
connection

string

必需。所引用集成连接器连接的完整资源名称。格式:projects/{project}/locations/{location}/connections/{connection}

action

object (Action)

必需。工具要使用的操作。

authConfig

object (EndUserAuthConfig)

可选。配置 Integration Connectors 中身份验证的处理方式。默认情况下,管理员身份验证会在 Integration Connectors API 请求中传递。您可以使用其他最终用户身份验证配置来替换它。注意:连接必须启用身份验证替换,才能在此处指定 EUC 配置;否则,ConnectorTool 创建将会失败。如需了解详情,请参阅 https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override

name

string

可选。代理可用于决定是否调用此 ConnectorTool 的工具的名称。

description

string

可选。工具的说明,代理可以使用此说明来决定是否调用此 ConnectorTool。

操作

JSON 表示法
{
  "inputFields": [
    string
  ],
  "outputFields": [
    string
  ],

  // Union field action_spec can be only one of the following:
  "connectionActionId": string,
  "entityOperation": {
    object (EntityOperation)
  }
  // End of list of possible types for union field action_spec.
}
字段
inputFields[]

string

可选。要用作操作输入的实体字段。如果未指定任何字段,则将使用实体的所有字段。

outputFields[]

string

可选。要从操作中返回的实体字段。如果未指定任何字段,则返回实体的所有字段。

联合字段 action_spec。要配置供工具使用的操作的规范。action_spec 只能是下列其中一项:
connectionActionId

string

供工具使用的连接操作的 ID。

entityOperation

object (EntityOperation)

供工具使用的实体操作配置。

EntityOperation

JSON 表示法
{
  "entityId": string,
  "operation": enum (OperationType)
}
字段
entityId

string

必需。实体的 ID。

operation

enum (OperationType)

必需。要对实体执行的操作。

EndUserAuthConfig

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "oauth2AuthCodeConfig": {
    object (Oauth2AuthCodeConfig)
  },
  "oauth2JwtBearerConfig": {
    object (Oauth2JwtBearerConfig)
  }
  // End of list of possible types for union field auth_config.
}
字段
联合字段 auth_config。身份验证配置。auth_config 只能是下列其中一项:
oauth2AuthCodeConfig

object (Oauth2AuthCodeConfig)

Oauth 2.0 授权代码身份验证。

oauth2JwtBearerConfig

object (Oauth2JwtBearerConfig)

JWT 配置文件 OAuth 2.0 授权许可身份验证。

Oauth2AuthCodeConfig

JSON 表示法
{
  "oauthToken": string
}
字段
oauthToken

string

必需。要传递的 OAuth 令牌形参名称。必须采用 $context.variables.<name_of_variable> 格式。

Oauth2JwtBearerConfig

JSON 表示法
{
  "issuer": string,
  "subject": string,
  "clientKey": string
}
字段
issuer

string

必需。要传递的提供方形参名称。必须采用 $context.variables.<name_of_variable> 格式。

subject

string

必需。要传递的主题形参名称。必须采用 $context.variables.<name_of_variable> 格式。

clientKey

string

必需。要传递的客户端参数名称。必须采用 $context.variables.<name_of_variable> 格式。

DataStoreTool

JSON 表示法
{
  "name": string,
  "description": string,
  "boostSpecs": [
    {
      object (BoostSpecs)
    }
  ],
  "modalityConfigs": [
    {
      object (ModalityConfig)
    }
  ],
  "filterParameterBehavior": enum (FilterParameterBehavior),

  // Union field search_source can be only one of the following:
  "dataStoreSource": {
    object (DataStoreSource)
  },
  "engineSource": {
    object (EngineSource)
  }
  // End of list of possible types for union field search_source.
}
字段
name

string

必需。数据存储区工具名称。

description

string

可选。工具说明。

boostSpecs[]

object (BoostSpecs)

可选。用于提升特定文档的提升规范。

modalityConfigs[]

object (ModalityConfig)

可选。数据存储区的模态配置。

filterParameterBehavior

enum (FilterParameterBehavior)

可选。过滤条件参数行为。

联合字段 search_source。定义搜索来源,可以是单个 DataStore 或引擎。search_source 只能是下列其中一项:
dataStoreSource

object (DataStoreSource)

可选。在单个特定数据存储区中搜索。

engineSource

object (EngineSource)

可选。在引擎内(可能跨多个数据存储区)进行搜索。

DataStoreSource

JSON 表示法
{
  "filter": string,
  "dataStore": {
    object (DataStore)
  }
}
字段
filter

string

可选。数据存储区的过滤条件规范。请参阅:https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata

dataStore

object (DataStore)

可选。数据存储区。

DataStore

JSON 表示法
{
  "name": string,
  "type": enum (DataStoreType),
  "documentProcessingMode": enum (DocumentProcessingMode),
  "displayName": string,
  "createTime": string,
  "connectorConfig": {
    object (ConnectorConfig)
  }
}
字段
name

string

必需。数据存储区的完整资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}

type

enum (DataStoreType)

仅限输出。数据存储区的类型。此字段为只读字段,由服务器填充。

documentProcessingMode

enum (DocumentProcessingMode)

仅限输出。数据存储区连接的文档处理模式。仅针对 PUBLIC_WEB 和 UNSTRUCTURED 数据存储区设置。

displayName

string

仅限输出。数据存储区的显示名称。

createTime

string (Timestamp format)

仅限输出。数据存储区的创建时间戳。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

connectorConfig

object (ConnectorConfig)

仅限输出。数据存储区连接的连接器配置。

时间戳

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
字段
seconds

string (int64 format)

表示世界协调时间 (UTC) 的秒数(从 Unix 纪元 1970-01-01T00:00:00Z 开始算起)。必须介于 -62135596800 到 253402300799 之间(含边界值),对应于 0001-01-01T00:00:00Z 到 9999-12-31T23:59:59Z。

nanos

integer

秒数的非负小数部分(以纳秒为单位)。此字段是时长的纳秒部分,而不是秒的替代项。对于含小数部分的负秒数,仍必须包含按时间递升的非负纳秒值。必须在 0 到 999,999,999 之间(含边界值)。

ConnectorConfig

JSON 表示法
{
  "collection": string,
  "collectionDisplayName": string,
  "dataSource": string
}
字段
collection

string

数据存储区所属集合的资源名称。

collectionDisplayName

string

数据存储区所属集合的显示名称。

dataSource

string

数据源的名称。示例:salesforcejiraconfluencebigquery

EngineSource

JSON 表示法
{
  "engine": string,
  "dataStoreSources": [
    {
      object (DataStoreSource)
    }
  ],
  "filter": string
}
字段
engine

string

必需。引擎的完整资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

dataStoreSources[]

object (DataStoreSource)

可选。用于定位引擎中的特定 DataStore。如果为空,则搜索适用于与 Engine 关联的所有数据存储区。

filter

string

可选。应用于整个引擎搜索的过滤条件。如果提供了“data_store_sources”,则此参数不相关且不会使用。请参阅:https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata

BoostSpecs

JSON 表示法
{
  "dataStores": [
    string
  ],
  "spec": [
    {
      object (BoostSpec)
    }
  ]
}
字段
dataStores[]

string

必需。应用了提升配置的数据存储区。数据存储区的完整资源名称,例如 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}。

spec[]

object (BoostSpec)

必需。提升规范列表。

BoostSpec

JSON 表示法
{
  "conditionBoostSpecs": [
    {
      object (ConditionBoostSpec)
    }
  ]
}
字段
conditionBoostSpecs[]

object (ConditionBoostSpec)

必需。提升规范列表。

ConditionBoostSpec

JSON 表示法
{
  "condition": string,
  "boost": number,
  "boostControlSpec": {
    object (BoostControlSpec)
  }
}
字段
condition

string

必需。用于指定提升条件的表达式。语法与过滤表达式语法相同。目前,唯一支持的条件是 BCP-47 语言代码列表。示例:提升英语或法语建议的效果:(lang_code: ANY("en", "fr"))

boost

number

可选。提升的强度,应介于 [-1, 1] 之间。设为负值代表降位。 默认值为 0.0。

设置为 1.0 可大幅提升建议的权重。不过,这并不一定意味着最佳结果会是提升后的建议。

设置为 -1.0 会大幅降低建议的权重。不过,系统可能仍会显示其他相关建议。

设置为 0.0 表示不应用任何提升。系统会忽略提升条件。

boostControlSpec

object (BoostControlSpec)

可选。基于客户定义的属性值的自定义排名复杂规范。

BoostControlSpec

JSON 表示法
{
  "fieldName": string,
  "attributeType": enum (AttributeType),
  "interpolationType": enum (InterpolationType),
  "controlPoints": [
    {
      object (ControlPoint)
    }
  ]
}
字段
fieldName

string

可选。将用于确定提升幅度的字段的名称。

attributeType

enum (AttributeType)

可选。用于确定提升幅度的属性类型。属性值可以从指定 field_name 的字段值派生而来。对于数值,这很简单,即 attribute_value = numerical_field_value。不过,对于新鲜度,attribute_value = (time.now() - datetime_field_value)。

interpolationType

enum (InterpolationType)

可选。用于连接下列控制点的插值类型。

controlPoints[]

object (ControlPoint)

可选。用于定义曲线的控制点。单调函数(通过上面的 interpolation_type 定义)会通过此处列出的控制点。

ControlPoint

JSON 表示法
{
  "attributeValue": string,
  "boostAmount": number
}
字段
attributeValue

string

可选。可以是以下值之一:1. 数值字段值。2. 新鲜度对应的时长规范:该值必须采用 XSD dayTimeDuration 值(ISO 8601 时长值的受限子集)的格式。该值的格式为:[nD][T[nH][nM][nS]]

boostAmount

number

可选。如果 attribute_value 的求值结果为上述指定的值,则该字段的值用于提升得分(介于 -1 到 1 之间)。

ModalityConfig

JSON 表示法
{
  "modalityType": enum (ModalityType),
  "rewriterConfig": {
    object (RewriterConfig)
  },
  "summarizationConfig": {
    object (SummarizationConfig)
  },
  "groundingConfig": {
    object (GroundingConfig)
  }
}
字段
modalityType

enum (ModalityType)

必需。模态类型。

rewriterConfig

object (RewriterConfig)

可选。重写器配置。

summarizationConfig

object (SummarizationConfig)

可选。总结配置。

groundingConfig

object (GroundingConfig)

可选。接地配置。

RewriterConfig

JSON 表示法
{
  "modelSettings": {
    object (ModelSettings)
  },
  "prompt": string,
  "disabled": boolean
}
字段
modelSettings

object (ModelSettings)

必需。LLM 模型的配置。

prompt

string

可选。提示定义。如果未设置,系统将使用默认提示。

disabled

boolean

可选。重写器是否已停用。

ModelSettings

JSON 表示法
{
  "model": string,

  // 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 模型。如果未设置,代理将沿用其父代理的模型。

联合字段 _temperature

_temperature 只能是下列其中一项:

temperature

number

可选。如果设置,系统将使用此温度值来运行 LLM 模型。温度可控制模型回答的随机性。温度越低,生成的回答就越可预测。温度越高,生成的回答就越有创意。

SummarizationConfig

JSON 表示法
{
  "modelSettings": {
    object (ModelSettings)
  },
  "prompt": string,
  "disabled": boolean
}
字段
modelSettings

object (ModelSettings)

可选。LLM 模型的配置。

prompt

string

可选。提示定义。如果未设置,系统将使用默认提示。

disabled

boolean

可选。是否已停用总结功能。

GroundingConfig

JSON 表示法
{
  "groundingLevel": number,
  "disabled": boolean
}
字段
groundingLevel

number

可选。根据检索到的来源得出的回答接地性阈值。该值的可配置范围为 [1, 5]。该级别用于设置回答接地程度的阈值,这意味着接地程度得分低于该阈值的所有回答都将回退到仅返回相关摘要。

例如,如果将此参数设置为 3,则只有当回答的依据充分性得分达到 3 或更高时,系统才会返回回答。

disabled

boolean

可选。接地是否已停用。

PythonFunction

JSON 表示法
{
  "name": string,
  "pythonCode": string,
  "description": string
}
字段
name

string

可选。要执行的 Python 函数的名称。必须与 Python 代码中定义的 Python 函数名称一致。区分大小写。如果未提供名称,系统将使用 Python 代码中定义的第一个函数。

pythonCode

string

可选。要为工具执行的 Python 代码。

description

string

仅限输出。从 Python 代码的文档字符串中解析出的 Python 函数说明。

McpTool

JSON 表示法
{
  "name": string,
  "description": string,
  "inputSchema": {
    object (Schema)
  },
  "outputSchema": {
    object (Schema)
  },
  "serverAddress": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  }
}
字段
name

string

必需。MCP 工具的名称。

description

string

可选。MCP 工具的说明。

inputSchema

object (Schema)

可选。MCP 工具的输入实参的架构。

outputSchema

object (Schema)

可选。MCP 工具的输出实参的架构。

serverAddress

string

必需。MCP 服务器的服务器地址,例如 “https://example.com/mcp/”。如果服务器是使用 MCP SDK 构建的,则网址应以“/mcp/”为后缀。仅支持基于可流式传输的 HTTP 传输的服务器。这与 McpToolset 中的 server_address 相同。如需了解详情,请参阅 https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http

apiAuthentication

object (ApiAuthentication)

可选。针对 MCP 服务器执行该工具所需的身份验证信息。对于不记名令牌身份验证,令牌仅适用于工具执行,而不适用于列出工具。这要求无需身份验证即可列出工具。

tlsConfig

object (TlsConfig)

可选。TLS 配置。包含客户端应信任的自定义服务器证书。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

可选。VPC-SC 的 Service Directory 配置,用于解析边界内的服务名称。

FileSearchTool

JSON 表示法
{
  "corpusType": enum (CorpusType),
  "name": string,
  "description": string,
  "fileCorpus": string
}
字段
corpusType

enum (CorpusType)

可选。语料库的类型。默认值为 FULLY_MANAGED。

name

string

必需。工具名称。

description

string

可选。工具说明。

fileCorpus

string

可选。存储文件的语料库。格式:projects/{project}/locations/{location}/ragCorpora/{rag_corpus}

SystemTool

JSON 表示法
{
  "name": string,
  "description": string
}
字段
name

string

必需。系统工具的名称。

description

string

仅限输出。系统工具的说明。

WidgetTool

JSON 表示法
{
  "name": string,
  "description": string,
  "widgetType": enum (WidgetType),

  // Union field input can be only one of the following:
  "parameters": {
    object (Schema)
  }
  // End of list of possible types for union field input.
}
字段
name

string

必需。widget 工具的显示名称。

description

string

可选。widget 工具的说明。

widgetType

enum (WidgetType)

可选。widget 工具的类型。如果未指定,则默认类型为 CUSTOMIZED。

联合字段 input。widget 工具的输入。input 只能是下列其中一项:
parameters

object (Schema)

可选。widget 工具的输入参数。

ToolFakeConfig

JSON 表示法
{
  "enableFakeMode": boolean,

  // Union field tool_response can be only one of the following:
  "codeBlock": {
    object (CodeBlock)
  }
  // End of list of possible types for union field tool_response.
}
字段
enableFakeMode

boolean

可选。工具是否处于模拟模式。

联合字段 tool_response。响应可以是静态的,也可以由 Python 函数提供。tool_response 只能是下列其中一项:
codeBlock

object (CodeBlock)

可选。将执行的代码块,而不是实际的工具调用。

CodeBlock

JSON 表示法
{
  "pythonCode": string
}
字段
pythonCode

string

必需。将在工具伪造模式下调用的 Python 代码。预期 Python 函数签名 - 捕获所有工具调用:def fake_tool_call(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]] 捕获特定工具调用:def fake_{tool_id}(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]] 如果函数返回 None,则会改为调用实际工具。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌