SYSTEM$CREATE_EVALUATION_DATASET

functionnot supportedAI & ML

docs.snowflake.com ↗

System functions

Creates a Snowflake dataset for Cortex Agent evaluations from an existing table. The new dataset is registered in the same database and schema as given in the dataset name argument. Use this function when you want to create an evaluation dataset with SQL (for example, following the Getting Started with Cortex Agent Evaluations guide). You can instead create a dataset from a table in Snowsight when you start an evaluation, or define a dataset block in your evaluation YAML file. For the table and column requirements for evaluation data, see Dataset format.

Syntax

CALL SYSTEM$CREATE_EVALUATION_DATASET(
  '<agent_dataset_type>' ,
  '<source_table_name>' ,
  '<dataset_name>' ,
  <column_mapping>
);

Parameters

NameRequiredDescription
'agent_dataset_type'requiredThe dataset type for Cortex Agent evaluations. Use the string Cortex Agent. This value is case-insensitive.
'source_table_name'requiredThe fully qualified name of the source table that contains evaluation inputs and ground truth columns (for example, MY_DB.MY_SCHEMA.MY_EVAL_TABLE).
'dataset_name'requiredThe fully qualified name for the dataset Snowflake creates (for example, MY_DB.MY_SCHEMA.MY_EVAL_DATASET). The dataset is created in the database and schema you specify.
column_mappingrequiredA SQL OBJECT that maps evaluation fields to source column names. Include: query_text: The name of the column that contains the input query (VARCHAR). expected_tools: The name of the VARIANT column that contains the expected behavior (ground truth) JSON for each row. Note The SYSTEM$CREATE_EVALUATION_DATASET column mapping keys differ from the Agent Evaluation YAML specification. In YAML, the dataset column_mapping uses the key ground_truth. When you call this system function, use expected_tools to map your source table’s ground truth VARIANT column.

Returns

A string message indicating whether the dataset was created successfully.

Access control requirements

You need permissions to create a dataset from an input table, including CREATE DATASET ON SCHEMA for the schema where the dataset is created.

See also

Referenced by