{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emile-wine/json-schema/emile-wine-bulk-insert-request-schema.json",
  "title": "BulkInsertRequest",
  "description": "Wrapper for the bulk_insert payload — keeps the door open for\nfuture top-level metadata (batch_id, source_run, etc.) without breaking\nthe wire format.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emile-wine-rag-internal-api-openapi.yml#/components/schemas/BulkInsertRequest",
  "properties": {
    "chunks": {
      "items": {
        "$ref": "#/$defs/KnowledgeChunk"
      },
      "type": "array",
      "title": "Chunks"
    }
  },
  "type": "object",
  "required": [
    "chunks"
  ],
  "$defs": {
    "KnowledgeChunk": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "source": {
          "type": "string",
          "title": "Source"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url"
        },
        "content_text": {
          "type": "string",
          "minLength": 10,
          "title": "Content Text"
        },
        "content_embedding": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Embedding"
        },
        "language": {
          "type": "string",
          "enum": [
            "fr",
            "en"
          ],
          "title": "Language"
        },
        "pillar": {
          "type": "string",
          "enum": [
            "vins",
            "viticulture",
            "cave",
            "sommellerie",
            "accord",
            "appellations"
          ],
          "title": "Pillar"
        },
        "topic": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Topic"
        },
        "token_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Count"
        }
      },
      "type": "object",
      "required": [
        "source",
        "content_text",
        "language",
        "pillar"
      ],
      "title": "KnowledgeChunk",
      "description": "A single ingested chunk with metadata."
    }
  }
}