ALTER AGENT¶
Modifies the properties or specification for an existing Cortex Agent.
- See also:
语法
必填参数
name用于指定要修改的代理标识符(即名称)的字符串。
If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
For more information, see Identifier requirements.
可选参数
SET ...为代理设置一个或多个指定的属性或参数:
COMMENT = comment指定代理的描述。
PROFILE = string指定代理的配置文件信息,例如显示名称、头像和颜色。如下所示,设置字符串格式:
下表描述了该字符串中的键值对:
键 类型 描述 display_name字符串 代理的显示名称。 avatar字符串 头像图像文件名或标识符。 color字符串 代理的颜色主题(例如“蓝色”、“绿色”、“红色”)
MODIFY LIVE VERSION SET SPECIFICATION specification指定一个 VARCHAR 包含代理替换设置的值,该值以 YAML 或 JSON 对象的形式存在。
- Dollar-quoted literal: $$ … $$
- Single-quoted string: ‘…’
规范对象的最大长度为 100,000 字节。
Important
新规范会完全取代现有规范。未包含在新规范中的字段将被移除。
YAML 对象应具有以下结构:
JSON 对象应具有以下结构:
下表描述了该对象中的键值对:
Key Type Description models`ModelConfig` An optional model configuration for the agent. Includes the orchestration model (e.g., claude-4-sonnet). If not provided, a model is automatically selected. Currently only available for the orchestration step. orchestration`OrchestrationConfig` An optional orchestration configuration, including budget constraints (e.g., seconds, tokens). instructions`AgentInstructions` Optional instructions for the agent’s behavior, including response, orchestration, and sample questions. toolsarray of `Tool` An optional list of tools available for the agent to use. Each tool includes a tool_specwith type, name, description, and input schema. Tools may have a corresponding configuration intool_resources.tool_resourcesmap of `ToolResource` An optional configuration for each tool referenced in the tools array. Keys must match the name of the respective tool.
访问控制要求
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| OWNERSHIP or MODIFY | Agent | 修改代理属性或规范所必需的权限。 OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the [GRANT OWNERSHIP](/sql-reference/sql/grant-ownership) command to a different role by the owning role (or any role with the MANAGE GRANTS privilege). |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
使用说明
-
When modifying a live version’s specification, the new specification completely replaces the existing one. Fields that are not included in the new specification are removed.
-
规范支持 YAML 和 JSON 两种格式。
-
无效的规范字段会导致错误。
-
关于元数据:
Attention
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.
示例
更新代理的注释:
更新代理的配置文件:
同时更新注释和配置文件:
使用 YAML 式更新实时版本规范:
使用 JSON 式更新实时版本规范: