{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/trust_assistant_questions.schema.json",
  "title": "tables/trust_assistant_questions.json",
  "description": "The rows of the table trust_assistant_questions that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "asked_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "locale": {
        "type": "string",
        "enum": [
          "en",
          "pl"
        ]
      },
      "question_redacted": {
        "type": [
          "string",
          "null"
        ]
      },
      "route": {
        "type": "string",
        "enum": [
          "refused",
          "language",
          "rules",
          "statement",
          "quote",
          "ai",
          "not_published"
        ]
      },
      "outcome": {
        "type": "string",
        "enum": [
          "answered",
          "not_published",
          "refused"
        ]
      },
      "fallback": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "model_off",
          "no_key",
          "daily_budget",
          "monthly_budget",
          "busy",
          "suspicious",
          "provider_error",
          "check_failed",
          null
        ]
      },
      "citations": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "answer": {
        "type": [
          "string",
          "null"
        ]
      },
      "corpus_version": {
        "type": "string"
      },
      "provider": {
        "type": [
          "string",
          "null"
        ]
      },
      "model": {
        "type": [
          "string",
          "null"
        ]
      },
      "prompt_version": {
        "type": [
          "string",
          "null"
        ]
      },
      "input_tokens": {
        "type": "integer"
      },
      "output_tokens": {
        "type": "integer"
      },
      "from_cache": {
        "type": "boolean"
      },
      "suspicious": {
        "type": "boolean"
      },
      "source": {
        "type": "string",
        "enum": [
          "visitor",
          "test"
        ]
      }
    },
    "required": [
      "id",
      "organization_id",
      "asked_at",
      "locale",
      "question_redacted",
      "route",
      "outcome",
      "fallback",
      "citations",
      "answer",
      "corpus_version",
      "provider",
      "model",
      "prompt_version",
      "input_tokens",
      "output_tokens",
      "from_cache",
      "suspicious",
      "source"
    ],
    "additionalProperties": false
  }
}
