{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codefmt-dev/json-schema/codefmt-dev-ask-response-schema.json",
  "title": "AskResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codefmt-dev-openapi.yml#/components/schemas/AskResponse",
  "type": "object",
  "required": [
    "answer",
    "sources",
    "results"
  ],
  "properties": {
    "query": {
      "type": "string",
      "description": "The question as received. Absent on the usage, query-too-long and rate-limit replies."
    },
    "answer": {
      "type": "string",
      "description": "The grounded answer, or the refusal text."
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Cited source URLs."
    },
    "results": {
      "type": "array",
      "description": "Ranked matching entries.",
      "items": {
        "type": "object",
        "required": [
          "label",
          "source",
          "score"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        }
      }
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "How much of the question the answer covers, weighted toward its rarer terms."
    }
  }
}