{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-evaluator-request-schema.json",
  "title": "CreateEvaluatorRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-evaluators-api-openapi.yml#/components/schemas/CreateEvaluatorRequest",
  "type": "object",
  "properties": {
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency."
    },
    "evaluatorName": {
      "type": "string",
      "description": "The name of the evaluator. Must be unique within your account."
    },
    "description": {
      "type": "string",
      "description": "The description of the evaluator that explains its purpose and evaluation criteria."
    },
    "evaluatorConfig": {
      "$ref": "#/$defs/EvaluatorConfig"
    },
    "level": {
      "type": "string",
      "enum": [
        "TOOL_CALL",
        "TRACE",
        "SESSION"
      ],
      "description": "The evaluation level that determines the scope of evaluation. Valid values are TOOL_CALL for individual tool invocations, TRACE for single request-response interactions, or SESSION for entire conversation sessions."
    },
    "kmsKeyArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of a customer managed KMS key to use for encrypting sensitive evaluator data, including instructions and rating scale. If you don't specify a KMS key, the evaluator data is encrypted with an Amazon Web Services owned key. Only symmetric encryption KMS keys are supported. For more information, see Encryption at rest for AgentCore Evaluations."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of tag keys and values to assign to an AgentCore Evaluator. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment."
    }
  },
  "required": [
    "evaluatorName",
    "evaluatorConfig",
    "level"
  ],
  "$defs": {
    "BedrockAgentcoreControlEvaluatorModelConfig": {
      "type": "object",
      "properties": {
        "bedrockEvaluatorModelConfig": {
          "$ref": "#/$defs/BedrockEvaluatorModelConfig"
        },
        "responsesEvaluatorModelConfig": {
          "$ref": "#/$defs/OpenResponsesEvaluatorModelConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "BedrockAgentcoreControlInferenceConfiguration": {
      "type": "object",
      "properties": {
        "maxTokens": {
          "type": "integer",
          "description": "The maximum number of tokens to generate in the model response during evaluation."
        },
        "temperature": {
          "type": "number",
          "description": "The temperature value that controls randomness in the model's responses. Lower values produce more deterministic outputs."
        },
        "topP": {
          "type": "number",
          "description": "The top-p sampling parameter that controls the diversity of the model's responses by limiting the cumulative probability of token choices."
        },
        "stopSequences": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of sequences that will cause the model to stop generating tokens when encountered."
        }
      }
    },
    "BedrockEvaluatorModelConfig": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "The identifier of the Amazon Bedrock model to use for evaluation. Must be a supported foundation model available in your region."
        },
        "inferenceConfig": {
          "$ref": "#/$defs/BedrockAgentcoreControlInferenceConfiguration"
        },
        "additionalModelRequestFields": {
          "type": "object",
          "description": "Additional model-specific request fields to customize model behavior beyond the standard inference configuration."
        }
      },
      "required": [
        "modelId"
      ]
    },
    "CategoricalScaleDefinition": {
      "type": "object",
      "properties": {
        "definition": {
          "type": "string",
          "description": "The description that explains what this categorical rating represents and when it should be used."
        },
        "label": {
          "type": "string",
          "description": "The label or name of this categorical rating option."
        }
      },
      "required": [
        "definition",
        "label"
      ]
    },
    "CodeBasedEvaluatorConfig": {
      "type": "object",
      "properties": {
        "lambdaConfig": {
          "$ref": "#/$defs/LambdaEvaluatorConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "DerivedEvaluatorConfig": {
      "type": "object",
      "properties": {
        "baseEvaluatorId": {
          "type": "string",
          "description": "The identifier of the base evaluator whose logic to run (a Builtin.* or ThirdParty.* evaluator)."
        },
        "modelConfig": {
          "$ref": "#/$defs/BedrockAgentcoreControlEvaluatorModelConfig"
        }
      },
      "required": [
        "baseEvaluatorId",
        "modelConfig"
      ]
    },
    "DimensionRatingScale": {
      "type": "object",
      "properties": {
        "numerical": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NumericalScaleDefinition"
          },
          "description": "The numerical rating scale with defined score values and descriptions for quantitative evaluation of the dimension."
        },
        "categorical": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CategoricalScaleDefinition"
          },
          "description": "The categorical rating scale with named categories and definitions for qualitative evaluation of the dimension."
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationDimension": {
      "type": "object",
      "properties": {
        "dimensionName": {
          "type": "string",
          "description": "The name of the dimension. This name is unique within the evaluator and identifies the dimension's results."
        },
        "dimensionInstruction": {
          "type": "string",
          "description": "The instruction to the evaluator model for this dimension, describing what the model should judge when scoring the dimension."
        },
        "dimensionRatingScale": {
          "$ref": "#/$defs/DimensionRatingScale"
        }
      },
      "required": [
        "dimensionName",
        "dimensionInstruction",
        "dimensionRatingScale"
      ]
    },
    "EvaluatorConfig": {
      "type": "object",
      "properties": {
        "llmAsAJudge": {
          "$ref": "#/$defs/LlmAsAJudgeEvaluatorConfig"
        },
        "codeBased": {
          "$ref": "#/$defs/CodeBasedEvaluatorConfig"
        },
        "derived": {
          "$ref": "#/$defs/DerivedEvaluatorConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "LambdaEvaluatorConfig": {
      "type": "object",
      "properties": {
        "lambdaArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Lambda function that implements the evaluation logic."
        },
        "lambdaTimeoutInSeconds": {
          "type": "integer",
          "description": "The timeout in seconds for the Lambda function invocation. Defaults to 60. Must be between 1 and 300."
        }
      },
      "required": [
        "lambdaArn"
      ]
    },
    "LlmAsAJudgeEvaluatorConfig": {
      "type": "object",
      "properties": {
        "instructions": {
          "type": "string",
          "description": "The evaluation instructions that guide the language model in assessing agent performance, including criteria and evaluation guidelines."
        },
        "ratingScale": {
          "$ref": "#/$defs/RatingScale"
        },
        "modelConfig": {
          "$ref": "#/$defs/BedrockAgentcoreControlEvaluatorModelConfig"
        }
      },
      "required": [
        "instructions",
        "ratingScale",
        "modelConfig"
      ]
    },
    "NumericalScaleDefinition": {
      "type": "object",
      "properties": {
        "definition": {
          "type": "string",
          "description": "The description that explains what this numerical rating represents and when it should be used."
        },
        "value": {
          "type": "number",
          "description": "The numerical value for this rating scale option."
        },
        "label": {
          "type": "string",
          "description": "The label or name that describes this numerical rating option."
        }
      },
      "required": [
        "definition",
        "value",
        "label"
      ]
    },
    "OpenResponsesEvaluatorModelConfig": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "The identifier of the model to use for evaluation."
        },
        "maxOutputTokens": {
          "type": "integer",
          "description": "The maximum number of tokens to generate in the model response, including visible output and reasoning tokens."
        },
        "temperature": {
          "type": "number",
          "description": "The temperature value that controls randomness in the model's responses. Lower values produce more deterministic outputs."
        },
        "topP": {
          "type": "number",
          "description": "The top-p sampling parameter that controls the diversity of the model's responses by limiting the cumulative probability of token choices."
        },
        "reasoning": {
          "$ref": "#/$defs/ReasoningConfiguration"
        }
      },
      "required": [
        "modelId"
      ]
    },
    "RatingScale": {
      "type": "object",
      "properties": {
        "numerical": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NumericalScaleDefinition"
          },
          "description": "The numerical rating scale with defined score values and descriptions for quantitative evaluation."
        },
        "categorical": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CategoricalScaleDefinition"
          },
          "description": "The categorical rating scale with named categories and definitions for qualitative evaluation."
        },
        "multiDimensional": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvaluationDimension"
          },
          "description": "A list of dimensions that lets an LLM-as-a-judge evaluator score several dimensions of the same target in a single evaluation. Each dimension has its own instruction and rating scale, and produces its own result."
        }
      },
      "description": "Exactly one member is set."
    },
    "ReasoningConfiguration": {
      "type": "object",
      "properties": {
        "effort": {
          "type": "string",
          "description": "The level of reasoning effort the model applies when generating a response. For supported values, see the model provider's documentation."
        }
      }
    }
  }
}