カテゴリ:

:doc:`/sql-reference/functions-table`(Cortex Agents)

GET_AI_OBSERVABILITY_LOGS (SNOWFLAKE.LOCAL)

Retrieve log data for an AI Observability event, such as a warning or failure, for a Cortex Agent or an External Agent application (see 外部エージェントコマンド).

Call this function to retrieve information about what events occurred during an evaluation run. For more information, see Cortex Agentの評価 and 観測可能データ.

こちらもご参照ください。

GET_AI_OBSERVABILITY_EVENTS (SNOWFLAKE.LOCAL) , GET_AI_RECORD_TRACE (SNOWFLAKE.LOCAL) , GET_AI_EVALUATION_DATA (SNOWFLAKE.LOCAL) , EXECUTE_AI_EVALUATION

構文

SNOWFLAKE.LOCAL.GET_AI_OBSERVABILITY_LOGS( <database>, <schema>, <agent_name>, <agent_type> )

引数

database

エージェントが含まれるデータベースの名前。

schema

エージェントが含まれるスキーマの名前。

agent_name

記録を取得するエージェントの名前。

agent_type

The agent type string. Use CORTEX AGENT for a Cortex Agent evaluation or EXTERNAL AGENT for an External Agent object (see 外部エージェントコマンド). This value is case-insensitive.

戻り値

AI Observabilityイベントに含まれる情報の詳細については、:ref:`label-ai_observability_data`をご参照ください。

アクセス制御の要件

この操作の実行に使用される ロール には、少なくとも次の 権限 が必要です。

権限

オブジェクト

メモ

CORTEX_USER

データベースロール

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.

スキーマ内のオブジェクトを操作するには、親データベースの少なくとも1つの権限と、親スキーマの少なくとも1つの権限が必要です。

指定された権限のセットを使用してカスタムロールを作成する手順については、 カスタムロールの作成 をご参照ください。

セキュリティ保護可能なオブジェクト に対して SQL アクションを実行するためのロールと権限付与に関する一般的な情報については、 アクセス制御の概要 をご参照ください。

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 観測可能データ.

次の例では、``eval_db.eval_schema``スキーマに格納されている``evaluated_agent``という名前のエージェントについて、``run-1``という名前の実行のエラーと警告をチェックします。

SELECT * FROM TABLE(SNOWFLAKE.LOCAL.GET_AI_OBSERVABILITY_LOGS(
  'eval_db',
  'eval_schema',
  'evaluated_agent',
  'CORTEX AGENT')
)
  WHERE TRUE
    AND (record:"severity_text"='ERROR' or record:"severity_text"='WARN')
    AND record_attributes:"snow.ai.observability.run.name"='run-1';