{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/takibibase-com/json-schema/takibibase-com-ask-answer-schema.json",
  "title": "AskAnswer",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/takibibase-com-openapi.yml#/components/schemas/AskAnswer",
  "type": "object",
  "properties": {
    "spans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Span"
      }
    },
    "citations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Citation"
      }
    },
    "support": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Versioned evidence support; not confidence."
    },
    "supportVersion": {
      "type": "string"
    },
    "abstained": {
      "type": "boolean"
    },
    "candidateCount": {
      "type": "integer"
    },
    "answerability": {
      "type": "string",
      "enum": [
        "answerable",
        "partial",
        "unanswerable",
        "unknown"
      ]
    },
    "conflict": {
      "type": "boolean"
    }
  },
  "required": [
    "spans",
    "citations",
    "support",
    "supportVersion",
    "abstained",
    "candidateCount",
    "answerability",
    "conflict"
  ],
  "$defs": {
    "Citation": {
      "type": "object",
      "properties": {
        "documentName": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "documentId": {
          "type": "string",
          "format": "uuid"
        },
        "chunkId": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "documentId",
        "documentName",
        "chunkId",
        "title"
      ]
    },
    "Span": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "documentName": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "documentId": {
          "type": "string",
          "format": "uuid"
        },
        "chunkId": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "text",
        "documentName",
        "title",
        "documentId",
        "chunkId"
      ]
    }
  }
}