{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-eval-run-output-item-schema.json",
  "title": "EvalRunOutputItem",
  "description": "A schema representing an evaluation run output item.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-ai-foundry-evals-api-openapi.yml#/components/schemas/EvalRunOutputItem",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "description": "The type of the object. Always \"eval.run.output_item\".",
      "default": "eval.run.output_item",
      "enum": [
        "eval.run.output_item"
      ],
      "x-ms-enum": {
        "modelAsString": false
      },
      "x-stainless-const": true
    },
    "id": {
      "type": "string",
      "description": "Unique identifier for the evaluation run output item."
    },
    "run_id": {
      "type": "string",
      "description": "The identifier of the evaluation run associated with this output item."
    },
    "eval_id": {
      "type": "string",
      "description": "The identifier of the evaluation group."
    },
    "created_at": {
      "type": "integer",
      "format": "unixtime",
      "description": "Unix timestamp (in seconds) when the evaluation run was created."
    },
    "status": {
      "type": "string",
      "description": "The status of the evaluation run."
    },
    "datasource_item_id": {
      "$ref": "#/$defs/OpenAI.integer",
      "description": "The identifier for the data source item."
    },
    "datasource_item": {
      "type": "object",
      "description": "Details of the input data source item.",
      "additionalProperties": {}
    },
    "results": {
      "type": "array",
      "description": "A list of grader results for this output item.",
      "items": {
        "$ref": "#/$defs/EvalRunOutputItemResult"
      }
    },
    "sample": {
      "$ref": "#/$defs/OpenAI.EvalRunOutputItemSample",
      "description": "A sample containing the input and output of the evaluation run."
    }
  },
  "required": [
    "object",
    "id",
    "run_id",
    "eval_id",
    "created_at",
    "status",
    "datasource_item_id",
    "datasource_item",
    "results",
    "sample"
  ],
  "x-oaiMeta": {
    "name": "The eval run output item object",
    "group": "evals"
  },
  "$defs": {
    "CompletionMessageToolCallChunk": {
      "type": "object",
      "description": "Tool call details within a message.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The Id for the tool call."
        },
        "type": {
          "type": "string",
          "description": "The type of tool call, which is always \"function\".",
          "enum": [
            "function"
          ],
          "x-ms-enum": {
            "modelAsString": false
          }
        },
        "function": {
          "$ref": "#/$defs/FunctionToolCall",
          "description": "Details of the function tool call, if applicable."
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "EvalRunOutputItemResult": {
      "type": "object",
      "title": "EvalRunOutputItemResult",
      "description": "A single grader result for an evaluation run output item.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the grader."
        },
        "type": {
          "type": "string",
          "description": "The grader type (for example, \"string-check-grader\")."
        },
        "score": {
          "$ref": "#/$defs/OpenAI.numeric",
          "description": "The numeric score produced by the grader."
        },
        "passed": {
          "type": "boolean",
          "description": "Whether the grader considered the output a pass."
        },
        "sample": {
          "type": [
            "object",
            "null"
          ],
          "description": "Optional sample or intermediate data produced by the grader.",
          "additionalProperties": {}
        },
        "metric": {
          "type": "string",
          "description": "The name of the metric (e.g., \"fluency\", \"f1_score\")."
        },
        "label": {
          "type": "string",
          "description": "The label associated with the test criteria metric (e.g., \"pass\", \"fail\", \"good\", \"bad\")."
        },
        "threshold": {
          "type": "number",
          "format": "float",
          "description": "The threshold used to determine pass/fail for this test criteria, if it is numerical."
        },
        "reason": {
          "type": "string",
          "description": "The reason for the test criteria metric."
        },
        "properties": {
          "type": "object",
          "description": "Additional details about the test criteria metric.",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": [
        "name",
        "score",
        "passed"
      ],
      "additionalProperties": {}
    },
    "EvalRunOutputItemSampleInput": {
      "type": "object",
      "description": "A message in the evaluation run.",
      "properties": {
        "role": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "tool_calls": {
          "type": "array",
          "description": "Tool calls made within the message, if any.",
          "items": {
            "$ref": "#/$defs/CompletionMessageToolCallChunk"
          }
        }
      },
      "required": [
        "role",
        "content",
        "tool_calls"
      ]
    },
    "EvalRunOutputItemSampleOutput": {
      "type": "object",
      "description": "A message in the evaluation run.",
      "properties": {
        "role": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "tool_calls": {
          "type": "array",
          "description": "Tool calls made within the message, if any.",
          "items": {
            "$ref": "#/$defs/CompletionMessageToolCallChunk"
          }
        }
      },
      "required": [
        "tool_calls"
      ]
    },
    "FunctionToolCall": {
      "type": "object",
      "description": "Details of a function tool call.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the function to call."
        },
        "arguments": {
          "type": "string",
          "description": "The arguments to call the function with, as generated by the model in JSON format."
        }
      },
      "required": [
        "name",
        "arguments"
      ]
    },
    "OpenAI.EvalApiError": {
      "type": "object",
      "title": "EvalApiError",
      "description": "An object representing an error response from the Eval API.",
      "properties": {
        "code": {
          "type": "string",
          "description": "The error code."
        },
        "message": {
          "type": "string",
          "description": "The error message."
        }
      },
      "required": [
        "code",
        "message"
      ],
      "x-oaiMeta": {
        "name": "The API error object",
        "group": "evals"
      }
    },
    "OpenAI.EvalRunOutputItemSample": {
      "type": "object",
      "properties": {
        "input": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvalRunOutputItemSampleInput"
          }
        },
        "output": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvalRunOutputItemSampleOutput"
          }
        },
        "finish_reason": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "usage": {
          "$ref": "#/$defs/OpenAI.EvalRunOutputItemSampleUsage"
        },
        "error": {
          "$ref": "#/$defs/OpenAI.EvalApiError"
        },
        "temperature": {
          "$ref": "#/$defs/OpenAI.numeric"
        },
        "max_completion_tokens": {
          "$ref": "#/$defs/OpenAI.integer"
        },
        "top_p": {
          "$ref": "#/$defs/OpenAI.numeric"
        },
        "seed": {
          "$ref": "#/$defs/OpenAI.integer"
        }
      },
      "required": [
        "input",
        "output",
        "finish_reason",
        "model",
        "usage",
        "error",
        "temperature",
        "max_completion_tokens",
        "top_p",
        "seed"
      ]
    },
    "OpenAI.EvalRunOutputItemSampleUsage": {
      "type": "object",
      "properties": {
        "total_tokens": {
          "$ref": "#/$defs/OpenAI.integer"
        },
        "completion_tokens": {
          "$ref": "#/$defs/OpenAI.integer"
        },
        "prompt_tokens": {
          "$ref": "#/$defs/OpenAI.integer"
        },
        "cached_tokens": {
          "$ref": "#/$defs/OpenAI.integer"
        }
      },
      "required": [
        "total_tokens",
        "completion_tokens",
        "prompt_tokens",
        "cached_tokens"
      ]
    },
    "OpenAI.integer": {
      "type": "integer",
      "format": "int64"
    },
    "OpenAI.numeric": {
      "type": "number",
      "format": "double"
    }
  }
}