エージェント評価パーサーツール

  • リリースバージョン: Australia
  • 更新日 2025年08月19日
  • 所要時間:5分
  • カスタムメトリクスのスクリプトでエージェント型評価パーサーツールの出力を使用して、効果的な AI エージェントとエージェント型ワークフローの基準をカスタマイズします。

    パーサーツールの概要

    エージェント型評価パーサーツールは、エージェント型ワークフローまたは AI エージェントの実行ログから構造化実行データを抽出します。ツールによって収集された情報を使用して、スクリプトを使用してエージェントワークフローを評価するカスタムメトリクスを作成できます。

    パーサーツールは、次のものを含む output.payload オブジェクト内の構造化された AI エージェントまたはエージェント型ワークフローの実行データを返します。

    • executionInputs:エージェントとツールの名前と指示、ユーザーの最初の発言など、初期ワークフローセットアップ情報を含む JSON オブジェクト
    • executionOutputs:AI エージェントアクションとツール実行結果を含む JSON オブジェクト
    • executionMessages:ユーザー向けの会話フローとシステム応答の JSON オブジェクトアレイ
    • executionPlanDetails:ステータス、sys_ids、構成値などの実行メタデータの JSON オブジェクト
    {
         "output": {
     "payload": {
      "executionInputs": { ... },
      "executionOutputs": { ... },
      "executionMessages": [ ... ],
      "executionPlanDetails": { ... }
     }
    }
    

    パーサーツールの出力へのアクセス

    テストと開発用の完全なパーサーツール出力を表示するには、次の手順を実行します。

    • カスタムメトリクスガイド付きセットアップの [スクリプトエディター] ビューに移動します。
    • [Run Test (テストを実行)] をクリックします。
    • テストが完了するまで待ちます。
    • テスト結果の [ツール] セクションで、完全な JSON 出力を表示します。

    カスタムメトリクスを設計する前にパーサーツールの出力を確認すると、特定のロジックを実装する前にデータ構造を検査できます。

    executionInputs データ構造

    executionInputs 属性には、次の構造の JSON オブジェクトが含まれています。

    "executionInputs": {
     "agenticWorkflow": "(name of agentic workflow)",
     "description": "(descriptions for agentic workflow)",
     "instructions": "(list of steps for agentic workflow)", 
     "utterance": "(initial user utterance)", 
     "agents": [ 
      { 
       "name": "(AI agent name)",  
       "instructions": "(list of steps for AI agent)", 
       "tools": [ 
        { 
         "name": "(tool name)", 
         "description": "(tool description)", 
         "executionMode": "(execution mode, either Autonomous or Supervised)", 
         "inputs": { ... } 
        }, 
        { ... }, ... 
       ]
      }, 
      { ... }, ... 
     ]
    }

    executionOutputs データ構造

    executionOutputs 属性には、次の構造の JSON オブジェクトが含まれています。

    "executionOutputs": {
     "agents": [ 
      { 
       "name": "(AI agent name)", 
       "subTask": { ... }, 
       "tools": [ 
        { 
         "name": "(tool name)", 
         "inputs": { ... }, 
         "output": { ... }
        }
       ]
      }, 
      { ... }, ... 
     ]
    }

    executionMessages データ構造

    executionOutputs 属性には、次の構造を持つ JSON オブジェクトの配列が含まれています。

    "executionMessages": [ 
     { 
      "role": "(Message sender, either 'agent' or 'user')", 
       "message": "(Content of message)", 
       "order": "(Sequence number indicating order of message in the conversation)"
      }, 
      { ... }, ... 
    ]
       

    executionPlanDetails データ構造

    executionPlanDetails 属性には、次の構造の JSON オブジェクトが含まれています。

    "executionPlanDetails": { 
        "state": "(Current execution status)", 
        "runType": "(Type of execution)", 
        "conversationId": "(sys_id of conversation)", 
        "relatedTask": "(sys_id of the associated task or record)", 
        "relatedTaskTable": "(Table name where the related task is stored)", 
        "context": { ... } (May be null)
        "builtInTools": [ { ... } ]
        }
       

    このセクションでは、ワークフローのパフォーマンスを追跡し、問題をデバッグし、実行を特定のタスクまたは会話に関連付けるための実行メタデータを提供します。

    runType には、次のものがあります。

    • API
    • チャット
    • 評価
    • テスト
    • トリガー

    メトリクススクリプトでのパーサーツール出力の使用

    パーサーツールのデータは、 context パラメーターを使用してメトリクススクリプトで使用できます。次のコードを使用して、構造化データにアクセスします。

    // Access the parser tool output from context
    var parserToolOutput = context['AgenticExecutionParserTool.output'];
    if (typeof parserToolOutput == "string") {
     parserToolOutput = JSON.parse(parserToolOutput);
    }
    var parserToolPayload = parserToolOutput.payload;
    var parserToolStatus = parserToolOutput.status;
        
    // Extract individual sections from payload
    var inputs = parserToolPayload.executionInputs;
    var outputs = parserToolPayload.executionOutputs;
    var messages = parserToolPayload.executionMessages;
    var planDetails = parserToolPayload.executionPlanDetails;