{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callidus-legal-ai/json-schema/callidus-legal-ai-chat-entry-response-schema.json",
  "title": "ChatEntryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callidus-legal-ai-chat-api-openapi.yml#/components/schemas/ChatEntryResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "started_at": {
      "type": "string",
      "format": "date-time",
      "title": "Started At"
    },
    "question": {
      "type": "string",
      "title": "Question"
    },
    "answer": {
      "type": "string",
      "title": "Answer"
    },
    "confidence": {
      "type": "integer",
      "title": "Confidence"
    },
    "rating": {
      "type": "integer",
      "title": "Rating"
    },
    "chat_id": {
      "type": "integer",
      "title": "Chat Id"
    },
    "sources": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ChatSource"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sources"
    }
  },
  "type": "object",
  "required": [
    "id",
    "started_at",
    "question",
    "answer",
    "confidence",
    "rating",
    "chat_id"
  ],
  "$defs": {
    "ChatSource": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "text": {
          "type": "string",
          "title": "Text",
          "default": ""
        },
        "page": {
          "type": "integer",
          "title": "Page"
        },
        "score": {
          "type": "number",
          "title": "Score"
        },
        "path": {
          "type": "string",
          "title": "Path"
        },
        "mime_type": {
          "type": "string",
          "title": "Mime Type"
        }
      },
      "type": "object",
      "required": [
        "name",
        "page",
        "score",
        "path",
        "mime_type"
      ],
      "title": "ChatSource",
      "description": "Describe the document in which a search/query result was found."
    }
  }
}