{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-evaluate-request-schema.json",
  "title": "EvaluateRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-evaluations-api-openapi.yml#/components/schemas/EvaluateRequest",
  "type": "object",
  "properties": {
    "evaluatorId": {
      "type": "string",
      "description": "The unique identifier of the evaluator to use for scoring. Can be a built-in evaluator (e.g., Builtin.Helpfulness, Builtin.Correctness) or a custom evaluator Id created through the control plane API."
    },
    "evaluationInput": {
      "$ref": "#/$defs/EvaluationInput"
    },
    "evaluationTarget": {
      "$ref": "#/$defs/EvaluationTarget"
    },
    "evaluationReferenceInputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvaluationReferenceInput"
      },
      "description": "Ground truth data to compare against agent responses during evaluation. Allows to provide expected responses, assertions, and expected tool trajectories at different evaluation levels. Session-level reference inputs apply to the entire conversation, while trace-level reference inputs target specific request-response interactions identified by trace ID."
    }
  },
  "required": [
    "evaluatorId",
    "evaluationInput"
  ],
  "$defs": {
    "Context": {
      "type": "object",
      "properties": {
        "spanContext": {
          "$ref": "#/$defs/SpanContext"
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationContent": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "The text content of the ground truth data. Used for expected response text and assertion statements."
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationExpectedTrajectory": {
      "type": "object",
      "properties": {
        "toolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of tool names representing the expected tool call sequence."
        }
      }
    },
    "EvaluationInput": {
      "type": "object",
      "properties": {
        "sessionSpans": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "The collection of spans representing agent execution traces within a session. Each span contains detailed information about tool calls, model interactions, and other agent activities that can be evaluated for quality and performance."
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationReferenceInput": {
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/$defs/Context"
        },
        "expectedResponse": {
          "$ref": "#/$defs/EvaluationContent"
        },
        "assertions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvaluationContent"
          },
          "description": "A list of assertion statements for session-level evaluation. Each assertion describes an expected behavior or outcome the agent should demonstrate during the session."
        },
        "expectedTrajectory": {
          "$ref": "#/$defs/EvaluationExpectedTrajectory"
        }
      },
      "required": [
        "context"
      ]
    },
    "EvaluationTarget": {
      "type": "object",
      "properties": {
        "spanIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of specific span IDs to evaluate within the provided traces. Used to target evaluation at individual tool calls or specific operations within the agent's execution flow."
        },
        "traceIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of trace IDs to evaluate, representing complete request-response interactions. Used to evaluate entire conversation turns or specific agent interactions within a session."
        }
      },
      "description": "Exactly one member is set."
    },
    "SpanContext": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "The unique identifier of the session containing this span. Sessions represent complete conversation flows and are detected using configurable SessionTimeoutMinutes (default 15 minutes)."
        },
        "traceId": {
          "type": "string",
          "description": "The unique identifier of the trace containing this span. Traces represent individual request-response interactions within a session and group related spans together."
        },
        "spanId": {
          "type": "string",
          "description": "The unique identifier of the specific span being referenced. Spans represent individual operations like tool calls, model invocations, or other discrete actions within the agent's execution."
        }
      },
      "required": [
        "sessionId"
      ]
    }
  }
}