{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/okareo/main/json-schema/okareo-scenario-set-generate-schema.json",
  "title": "ScenarioSetGenerate",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/okareo-openapi.json#/components/schemas/ScenarioSetGenerate",
  "properties": {
    "project_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Id",
      "description": "ID for the project"
    },
    "source_scenario_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Scenario Id",
      "description": "ID for the scenario set that the generated scenario set will use as a source. Will throw an exception if 'source_scenario_rows' is also provided."
    },
    "source_scenario_rows": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ScenarioDataPoinResponse"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Scenario Rows",
      "description": "Rows for the scenario set that the generated scenario set will use as a source. Will throw an exception if 'source_scenario_id' is also provided."
    },
    "synonym_sets": {
      "anyOf": [
        {
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Synonym Sets",
      "description": "2D list used by the generator to determine synonyms. Used with the SYNONYMS generation type."
    },
    "save_generated_scenario": {
      "type": "boolean",
      "title": "Save Generated Scenario",
      "description": "Whether to save the generated scenarios. Defaults to True.",
      "default": true
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Name of the generated scenario set"
    },
    "number_examples": {
      "type": "integer",
      "title": "Number Examples",
      "description": "Number of examples to be generated for the scenario set"
    },
    "generation_type": {
      "$ref": "#/$defs/ScenarioType",
      "description": "Type of generation. Current supported scenario types are:<br />\n        Seed: Seed data for a scenario set<br />\n        Rephrase invariant: Results will be rephrased versions of inputs<br />\n        Conditional: Results will be rephrased inputs represented in a conditional format<br />\n        Text reverse question: The result will be the target question for the input<br />\n        Text reverse label: The result will be the intent of the target question for the input",
      "default": "REPHRASE_INVARIANT"
    },
    "generation_tone": {
      "$ref": "#/$defs/GenerationTone",
      "description": "Tone to use for scenario generation.",
      "default": "Neutral"
    },
    "generation_prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Generation Prompt",
      "description": "Prompt for the generator to use when generating scenarios. Only supported by CustomGenerator type."
    },
    "generation_schema": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Generation Schema",
      "description": "Structured output schema for the generator to use when generating scenarios. Only supported by CustomGenerator type."
    },
    "pre_template": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pre Template",
      "description": "Template for pre-processing scenario before sending it to generator"
    },
    "post_template": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Post Template",
      "description": "Template for post-processing scenario after generator before it's saved"
    },
    "lock_result": {
      "type": "boolean",
      "title": "Lock Result",
      "description": "Whether to lock the result of the generated scenario. Used in the Custom Generator type.",
      "default": false
    },
    "checks": {
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "additionalProperties": true,
            "type": "object"
          }
        ]
      },
      "type": "array",
      "title": "Checks",
      "description": "List of check names or check configs to run on the generated scenarios",
      "default": []
    }
  },
  "type": "object",
  "required": [
    "name",
    "number_examples"
  ],
  "$defs": {
    "GenerationTone": {
      "type": "string",
      "enum": [
        "Neutral",
        "Formal",
        "Informal",
        "Abbreviated Informal",
        "Persuasive",
        "Empathetic"
      ],
      "title": "GenerationTone"
    },
    "ScenarioDataPoinResponse": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "input": {
          "title": "Input"
        },
        "result": {
          "title": "Result"
        },
        "meta_data": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Meta Data"
        }
      },
      "type": "object",
      "required": [
        "id",
        "input",
        "result"
      ],
      "title": "ScenarioDataPoinResponse"
    },
    "ScenarioType": {
      "type": "string",
      "enum": [
        "SEED",
        "REPHRASE_INVARIANT",
        "CONDITIONAL",
        "TEXT_REVERSE_QUESTION",
        "TEXT_REVERSE_LABELED",
        "TEXT_REVERSE_QUESTION_ANSWER",
        "TERM_RELEVANCE_INVARIANT",
        "COMMON_CONTRACTIONS",
        "COMMON_MISSPELLINGS",
        "SYNONYMS",
        "OFF_TOPIC",
        "ADVERSARIAL_QUESTION",
        "WORD_INFLECTIONS",
        "WORD_QWERTY_MISSPELL",
        "WORD_CHARACTER_INSERTION",
        "WORD_SYNONYM_EMBEDDING",
        "CUSTOM_GENERATOR",
        "CUSTOM_MULTI_CHUNK_GENERATOR",
        "DRIVER",
        "LABEL_REVERSE_INVARIANT",
        "ROUNDTRIP_INVARIANT",
        "NEGATION",
        "NAMED_ENTITY_SUBSTITUTION"
      ],
      "title": "ScenarioType"
    }
  }
}