{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/jovo-language-models/latest.json",
  "title": "JSON Schema for Jovo language Models",
  "description": "JSON Schema for Jovo language Models (https://www.jovo.tech/docs/model)",
  "x-lintel": {
    "source": "https://www.schemastore.org/jovo-language-model.json",
    "sourceSha256": "2c4d51d3b3fddab6c2311174221c5a1f6f252827518cddd8df5b22d59feaec76"
  },
  "type": "object",
  "properties": {
    "invocation": {
      "type": "string"
    },
    "intents": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "phrases"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "phrases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dialogflow": {
            "type": "object",
            "properties": {
              "priority": {
                "type": "number"
              },
              "webhookForSlotFilling": {
                "type": "boolean"
              }
            }
          },
          "inputs": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "type"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": [
                    "string",
                    "object"
                  ],
                  "properties": {
                    "alexa": {
                      "type": "string"
                    },
                    "dialogflow": {
                      "type": "string"
                    }
                  }
                },
                "dialogflow": {
                  "$ref": "#/$defs/dialogflowEntity"
                }
              }
            }
          }
        }
      }
    },
    "inputTypes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "dialogflow": {
            "type": "object",
            "properties": {
              "automatedExpansion": {
                "type": "boolean"
              }
            }
          },
          "values": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "value"
              ],
              "properties": {
                "value": {
                  "type": "string"
                },
                "synonyms": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "alexa": {
      "type": "object",
      "properties": {
        "interactionModel": {
          "type": "object",
          "properties": {
            "languageModel": {
              "type": "object",
              "properties": {
                "intents": {
                  "type": "array",
                  "items": {
                    "required": [
                      "name",
                      "samples"
                    ],
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "samples": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "dialogflow": {
      "type": "object",
      "properties": {
        "intents": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "auto": {
                "type": "boolean"
              },
              "webhookUsed": {
                "type": "boolean"
              },
              "fallbackIntent": {
                "type": "boolean"
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "entities": {
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/dialogflowEntity"
              },
              {
                "type": "object",
                "required": [
                  "name"
                ]
              }
            ]
          }
        }
      }
    }
  },
  "required": [
    "invocation"
  ],
  "$defs": {
    "dialogflowEntity": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "isOverridable": {
          "type": "boolean"
        },
        "isEnum": {
          "type": "boolean"
        },
        "automatedExpansion": {
          "type": "boolean"
        },
        "isList": {
          "type": "boolean"
        }
      }
    }
  }
}
