{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/docspeed-ai/json-schema/docspeed-ai-ask-request-schema.json",
  "title": "AskRequest",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/docspeed-ai-openapi.json#/components/schemas/AskRequest",
  "properties": {
    "input": {
      "anyOf": [
        {
          "$ref": "#/$defs/InputSource"
        },
        {
          "type": "null"
        }
      ]
    },
    "inputs": {
      "items": {
        "$ref": "#/$defs/InputSource"
      },
      "type": "array",
      "title": "Inputs"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id",
      "description": "Reusable session returned by a prior document-grounded Ask response. When provided with the same ordered inputs, Docspeed reuses prepared parsing and indexing. Valid reusable Ask sessions use the generated session_id_ prefix."
    },
    "execution_mode": {
      "type": "string",
      "enum": [
        "async",
        "sync"
      ],
      "title": "Execution Mode",
      "default": "async"
    },
    "query": {
      "type": "string",
      "title": "Query"
    },
    "include_grounding": {
      "type": "boolean",
      "title": "Include Grounding",
      "default": true
    },
    "response_language": {
      "type": "string",
      "enum": [
        "en",
        "ar",
        "es",
        "pt",
        "fr",
        "de",
        "nl",
        "it",
        "hi",
        "ru"
      ],
      "title": "Response Language",
      "default": "en"
    }
  },
  "type": "object",
  "required": [
    "query"
  ],
  "$defs": {
    "InputSource": {
      "properties": {
        "file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Id"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "markdown": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Markdown"
        },
        "image_base64": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Base64"
        },
        "pdf_base64": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pdf Base64"
        },
        "filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filename"
        }
      },
      "type": "object",
      "title": "InputSource"
    }
  }
}