GET_AI_RECORD_TRACE
functionnot supportedAI & MLRetrieve a single trace record from an evaluation run for a Cortex Agent or for an External Agent application that stores traces in AI_OBSERVABILITY_EVENTS (see External Agent commands). Call this function when you want to inspect a single record from a complete evaluation. For more information, see Cortex Agent evaluations and AI_OBSERVABILITY_EVENTS table.
Syntax
SNOWFLAKE.LOCAL.GET_AI_RECORD_TRACE( <database> , <schema> , <agent_name> , <agent_type> , <record_id> )
Parameters
| Name | Required | Description |
|---|---|---|
database | required | Name of the database containing the agent. |
schema | required | Name of the schema containing the agent. |
agent_name | required | Name of the agent to retrieve a record for. |
agent_type | required | The agent type string. Use CORTEX AGENT for a Cortex Agent or EXTERNAL AGENT for an External Agent object. This value is case-insensitive. |
record_id | required | The record identifier to retrieve. |
Returns
A table containing information for the requested trace, with the following columns:
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes CORTEX_USER | Database role | USAGE | Cortex Agent or External Agent | Required on the object identified by agent_name. For EXTERNAL AGENT, USAGE on the External Agent is sufficient to call this function (MONITOR does not apply). MONITOR | Cortex Agent | Required on the Cortex Agent identified by agent_name when agent_type is CORTEX AGENT. Does not apply when agent_type is EXTERNAL AGENT. 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 agent_type is EXTERNAL AGENT, only USAGE on that object is required to call this function. OWNERSHIP on the External Agent is required to modify or remove the object with ALTER EXTERNAL AGENT or DROP EXTERNAL AGENT. For the full access control permissions required by Cortex Agent evaluations, see Cortex Agent evaluations: access control requirements. For External Agent objects, see AI_OBSERVABILITY_EVENTS table.
See also
- EXECUTE_AI_EVALUATION
- GET_AI_EVALUATION_DATA (SNOWFLAKE.LOCAL)
- GET_AI_OBSERVABILITY_LOGS (SNOWFLAKE.LOCAL)
- GET_AI_OBSERVABILITY_EVENTS (SNOWFLAKE.LOCAL)