DESCRIBE AGENT¶
描述 Cortex Agent 的属性。
DESCRIBE 可以缩写为 DESC。
语法¶
{ DESC | DESCRIBE } AGENT <name>
参数¶
name指定要描述的代理名称。
如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
输出¶
命令输出在以下列中提供 Cortex Agent 属性和元数据:
列 |
描述 |
|---|---|
|
代理的名称。 |
|
包含代理的数据库。 |
|
包含代理的架构。 |
|
代理的所有者角色。 |
|
代理的注释文本。 |
|
代理配置文件 JSON(显示名称、头像、颜色)。 |
|
代理的完整 YAML 规范。 |
|
创建代理时的时间戳。 |
访问控制要求¶
用于执行此 SQL 命令的 角色 必须至少具有以下 一项 权限:
权限 |
对象 |
备注 |
|---|---|---|
以下任何一项权限:OWNERSHIP、USAGE、MONITOR 或者 OPERATE |
代理 |
要对架构中的任何对象执行操作,需要对父数据库和架构的 USAGE 权限。请注意,如果某个角色获授某个架构的任意权限,该角色便能够解析该架构。例如,若某角色被授予 CREATE 权限,则可以在该架构上创建对象,而无需 同时 被授予该架构的 USAGE 权限。
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
要对该命令的输出进行后处理,可以使用 管道运算符 (
->>) 或 RESULT_SCAN 函数。这两种构造都将输出视为可以查询的结果集。For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
示例¶
描述 TEST_DATABASE 数据库和 TEST_SCHEMA 架构中名为 MY_AGENT1 的 Cortex Agent:
DESCRIBE AGENT mydb.myschema.my_agent;
示例中的语句打印以下输出:
+--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------+
| name | database_name | schema_name | owner | comment | profile | agent_spec | created_on |
|--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------|
|| TEST_AGENT | EXAMPLE_DB | AGENTS | TEST_ROLE | null | {"display_name":"test"} | "{\"models\":{\"orchestration\":\"llama3.1-70B\"},\"nested\":{\"key\":\"value\"}},\"orchestration\":{\"budget\":{\"seconds\":30,\"tokens\":16000}},\"instructions\":{\"response\":\"You will respond in a friendly but concise manner\",\"orchestration\":\"For any revenue question use Analyst; for policy use Search\",\"system\":\"You are a friendly agent.\",\"sample_questions\":[{\"question\":\"question 1\"},{\"question\":\"question 2\"},{\"question\":\"question 3\"}]},\"tools\":[{\"tool_spec\":{\"type\":\"cortex_analyst_text_to_sql\",\"name\":\"Analyst1\",\"description\":\"test\"}},{\"tool_spec\":{\"type\":\"cortex_analyst_sql_exec\",\"name\":\"SQL_exec1\"}},{\"tool_spec\":{\"type\":\"cortex_search\",\"name\":\"Search1\"}},{\"tool_spec\":{\"type\":\"web_search\",\"name\":\"web_search_1\"}},{\"tool_spec\":{\"type\":\"generic\",\"name\":\"get_weather\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state\"}},\"required\":[\"Location\"]}}}],\"tool_unable_to_answer\":\"I don't know the answer to that\",\"tool_resources\":{\"Analyst1\":{\"semantic_model_file\":\"stage1\"},\"Analyst2\":{\"semantic_view\":\"db.schema.semantic_view\"},\"Search1\":{\"name\":\"db.schema.service_name\",\"Max_results\":\"5\",\"filter\":{\"@eq\":{\"region\":\"North America\"}},\"Title_column\":\"<title_name>\",\"ID_column\":\"<column_name>\"},\"SQL_exec1\":{\"Name\":\"my_warehouse\",\"Timeout\":\"30\",\"AutoExecute\":\"true\"},\"web_search\":{\"name\":\"web_search_1\",\"Function\":\"db/schema/search_web\"}}}" | 2025-09-15 17:04:37.263 +0000 |
+--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------+
以下示例描述了当前架构中的代理:
DESCRIBE AGENT my_agent;
以下示例将代理描述为采用 JSON 格式的资源:
DESCRIBE AS RESOURCE AGENT my_agent;