{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-table-artifact-enrichment-list-schema.json",
  "title": "TableArtifactEnrichmentList",
  "description": "Table-level generated artifact enrichments configured for a table.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-index-management-api-openapi.yml#/components/schemas/TableArtifactEnrichmentList",
  "type": "object",
  "required": [
    "table_name",
    "artifacts"
  ],
  "properties": {
    "table_name": {
      "type": "string",
      "description": "Table containing the configured artifact enrichments."
    },
    "artifacts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EnrichmentConfig"
      }
    }
  },
  "$defs": {
    "AntflyChunkerConfig": {
      "description": "Configuration for the Antfly inference chunking provider.\n\nAntfly inference is Antfly's built-in ML service for local chunking.\n\n**Chunking Models:**\n- fixed: Fixed-size chunking by token count, with fixed time windows for audio\n  (aliases `fixed_bert`, `fixed_bpe`, and `fixed-bert-tokenizer`). This is the\n  only chunking model Antfly inference implements; other model names are\n  rejected as unsupported.\n\n**Deduplication:**\n- Within a single document write, chunk results are deduplicated when multiple\n  indexes share the same source text and chunker configuration, so the source\n  is chunked at most once per write.\n",
      "allOf": [
        {
          "$ref": "#/$defs/ChunkOptions"
        },
        {
          "type": "object",
          "properties": {
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint (e.g., 'http://localhost:8080'). Can also be set via ANTFLY_INFERENCE_URL environment variable."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            }
          }
        }
      ]
    },
    "AntflyGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Antfly inference generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the generator model."
        },
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL environment variable."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Inference API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AntflySTTConfig": {
      "type": "object",
      "required": [
        "model"
      ],
      "description": "Configuration for Antfly inference STT (Whisper, Wav2Vec2, HuBERT) provider.\n\nUses the Antfly inference service for speech-to-text inference.\n\n**Supported Models:** openai/whisper-tiny, openai/whisper-base, facebook/wav2vec2-base\n\n**Supported Formats:** WAV (recommended), MP3, FLAC, M4A/AAC\n\n**Docs:** See inference documentation",
      "properties": {
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "Inference API URL. Falls back to ANTFLY_INFERENCE_URL environment variable."
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "description": "Explicit Antfly transcriber model name (e.g., 'openai/whisper-tiny')."
        }
      }
    },
    "AnthropicGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Anthropic generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "anthropic"
          ]
        },
        "workspace_id": {
          "type": "string",
          "description": "Anthropic workspace for keys not scoped to a workspace. Defaults to ANTHROPIC_WORKSPACE_ID."
        },
        "model": {
          "type": "string",
          "description": "The full model ID of the Anthropic model to use.",
          "default": "claude-sonnet-4-5-20250929"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "Anthropic API key or secret reference. Defaults to ANTHROPIC_API_KEY."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Messages API base URL. Defaults to https://api.anthropic.com/v1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AppleGeneratorConfig": {
      "type": "object",
      "description": "On-device Apple Foundation Models generation. Requires a macOS Apple provider build, Apple Intelligence enabled, and its system model ready. Supports text conversations; tool calling and media attachments are not supported.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "apple"
          ]
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 256
        },
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "AppleSTTConfig": {
      "type": "object",
      "description": "On-device SpeechAnalyzer file transcription. Requires a macOS Apple provider build and supported Speech assets. Diarization is unsupported.",
      "properties": {
        "language_code": {
          "type": "string",
          "default": "en-US",
          "description": "Supported Speech locale; Apple transcription does not infer a language."
        },
        "timestamps": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        },
        "download_assets": {
          "type": "boolean",
          "default": false,
          "description": "Explicitly permit preparing and installing the selected Speech assets."
        }
      }
    },
    "AudioChunkOptions": {
      "type": "object",
      "description": "Options specific to audio chunking.",
      "properties": {
        "window_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Window duration in milliseconds for fixed-window audio chunking (default: 30000)."
        },
        "overlap_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Overlap duration in milliseconds between audio chunks (default: 0)."
        }
      }
    },
    "BedrockGeneratorConfig": {
      "type": "object",
      "description": "AWS Bedrock Converse generation, including image inputs and tools for\nmodels that support them. Uses the AWS default credential chain unless\nan explicit Bedrock API key is configured. Image capability is declared\nper target through inference_capabilities; model IDs are not allowlisted.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "bedrock"
          ]
        },
        "url": {
          "type": "string",
          "description": "Optional Bedrock Runtime endpoint override. Defaults to the regional AWS endpoint."
        },
        "api_key": {
          "type": "string",
          "description": "Optional Bedrock bearer API key or secret reference. Omit to use signed AWS requests and the default credential chain."
        },
        "model": {
          "type": "string",
          "description": "The Bedrock model ID to use."
        },
        "region": {
          "type": "string",
          "description": "AWS region. Defaults to AWS_REGION, then AWS_DEFAULT_REGION, then us-east-1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "ChatGPTGeneratorConfig": {
      "type": "object",
      "description": "Personal ChatGPT plan for interactive generation. Credentials stay in the local runtime.",
      "required": [
        "provider",
        "model",
        "connection_id"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "chatgpt"
          ]
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort"
        },
        "model": {
          "type": "string"
        },
        "connection_id": {
          "type": "string",
          "description": "Opaque personal registration owned by the authenticated caller."
        }
      }
    },
    "ChunkDiarizationConfig": {
      "type": "object",
      "description": "Source-wide online speaker clustering on a fixed 1.5 s grid with 3 s embedding windows. Identities are stable within a source and recipe. Silence and ambiguous voices remain unassigned. Analysis advances incrementally; admitted cached timelines and durable centroid/sample-position checkpoints are shared across matching outputs and continuations. Missing checkpoints reconstruct the required prefix deterministically.",
      "properties": {
        "model": {
          "type": "string",
          "description": "Speaker ONNX registry reference; defaults to 3D-Speaker CAM++. For kind=diarize the target model selects the speaker model."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional SHA-256 pin of the speaker ONNX file, including when paired with a transcription model."
        },
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.45
        },
        "ambiguity_margin": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.03
        },
        "min_rms": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.01
        },
        "max_speakers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 64,
          "default": 64
        }
      }
    },
    "ChunkEmbeddingTarget": {
      "type": "object",
      "required": [
        "model"
      ],
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1
        },
        "model_identity": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional required embedding-weight/recipe identity; a changed model is rejected before delivery."
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "execute": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "False resolves model limits and plans descriptors without running embedding inference."
        },
        "allow_partial": {
          "type": "boolean",
          "default": false,
          "description": "Return explicit per-chunk failures and gaps instead of aborting on the first non-retryable embedding failure."
        }
      }
    },
    "ChunkOptions": {
      "type": "object",
      "description": "Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.",
      "properties": {
        "max_chunks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "description": "Maximum chunks in one response; zero requests the full result. Model-aware responses return continuation coverage when a page is full: follow next_continuation until source_complete. Embedded model-aware enrichment uses this as its page size and continues through the entire source. Fixed chunking without model-aware outputs retains its per-call truncation behavior."
        },
        "threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence threshold for model-based chunking (0.0-1.0)."
        },
        "text": {
          "$ref": "#/$defs/TextChunkOptions"
        },
        "audio": {
          "$ref": "#/$defs/AudioChunkOptions"
        },
        "embedding": {
          "$ref": "#/$defs/ChunkEmbeddingTarget"
        },
        "outputs": {
          "$ref": "#/$defs/ChunkOutputs"
        },
        "policy": {
          "$ref": "#/$defs/MediaChunkPolicy"
        }
      }
    },
    "ChunkOutputTarget": {
      "type": "object",
      "required": [
        "name",
        "kind",
        "model"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "kind": {
          "type": "string",
          "enum": [
            "embedding",
            "transcribe",
            "classify",
            "diarize"
          ]
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "execute": {
          "type": "boolean",
          "default": true,
          "description": "False retains this model as a planning boundary while skipping its inference; used for independent output repairs."
        },
        "skip_windows": {
          "type": "array",
          "maxItems": 4096,
          "description": "Execution-only repair mask for already accepted sub-windows; does not affect the model recipe or boundary plan. Skipped windows return receipts with status skipped.",
          "items": {
            "type": "object",
            "required": [
              "ordinal",
              "sub_index"
            ],
            "properties": {
              "ordinal": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "sub_index": {
                "type": "integer",
                "format": "uint32",
                "minimum": 0
              }
            }
          }
        },
        "required": {
          "type": "boolean",
          "default": true
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "language": {
          "type": "string"
        },
        "diarize": {
          "type": "boolean",
          "default": false,
          "description": "Convenience option on transcription outputs; enables source-wide diarization with the default speaker model."
        },
        "diarization": {
          "description": "Speaker settings for diarize or transcribe outputs; also accepted on the selected audio embedding boundary with audio_speaker_turns=true.",
          "$ref": "#/$defs/ChunkDiarizationConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 5
        }
      }
    },
    "ChunkOutputs": {
      "type": "object",
      "required": [
        "boundary_model",
        "targets"
      ],
      "description": "Named independent media outputs. The named boundary model alone determines the shared plan; adding or changing another output preserves parent IDs. The compatibility embedding target is named embedding. Smaller output windows are identified by the parent ordinal and sub_index.",
      "properties": {
        "boundary_model": {
          "type": "string",
          "minLength": 1
        },
        "targets": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/ChunkOutputTarget"
          }
        }
      }
    },
    "ChunkerConfig": {
      "description": "A unified configuration for a chunking provider.",
      "allOf": [
        {
          "$ref": "#/$defs/AntflyChunkerConfig"
        },
        {
          "type": "object",
          "properties": {
            "provider": {
              "$ref": "#/$defs/ChunkerProvider"
            },
            "store_chunks": {
              "x-go-type-skip-optional-pointer": true,
              "type": "boolean",
              "description": "Controls whether chunk data is persisted to storage. When false (default), fixed chunks are generated in memory and only embeddings are stored. Model-aware streams always retain descriptor recipes; false omits their payloads. When true, chunk payloads are also stored. Vectors remain in the embedding artifact family.",
              "default": false
            },
            "full_text_index": {
              "x-go-type-skip-optional-pointer": true,
              "type": "object",
              "description": "Configuration for full-text indexing of chunks.\nWhen present (even if empty), chunk artifacts are persisted and indexed in Antfly's native full-text index, queryable and projectable via the document's `_chunks` field.\nWhen absent, chunks are generated only to drive vector embeddings and are not indexed for full-text search (unless `store_chunks` is also set).\n",
              "additionalProperties": true
            },
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            },
            "max_chunks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4096,
              "description": "Maximum chunks per invocation. Model-aware enrichment treats this as a page size and resumes until source completion; zero selects the worker page size. Fixed chunking retains its per-document cap, with zero meaning unlimited."
            },
            "threshold": {
              "type": "number",
              "format": "float",
              "minimum": 0,
              "maximum": 1
            },
            "text": {
              "$ref": "#/$defs/TextChunkOptions"
            },
            "audio": {
              "$ref": "#/$defs/AudioChunkOptions"
            },
            "embedding": {
              "$ref": "#/$defs/ChunkEmbeddingTarget"
            },
            "outputs": {
              "$ref": "#/$defs/ChunkOutputs"
            },
            "policy": {
              "$ref": "#/$defs/MediaChunkPolicy"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "ChunkerProvider": {
      "type": "string",
      "enum": [
        "mock",
        "antfly"
      ],
      "description": "The chunking provider to use."
    },
    "CloudflareGeneratorConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI generation. Uses CLOUDFLARE_API_TOKEN or an Antfly secret reference.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "gateway_id": {
          "type": "string",
          "minLength": 1,
          "description": "Optional AI Gateway ID, sent through cf-aig-gateway-id."
        },
        "model": {
          "type": "string",
          "default": "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "url": {
          "type": "string",
          "description": "Optional deployment-owned endpoint override."
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 2
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        }
      },
      "required": [
        "provider",
        "account_id",
        "model"
      ]
    },
    "CloudflareSTTConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI native speech adapter. Credentials use CLOUDFLARE_API_TOKEN.",
      "required": [
        "provider",
        "account_id",
        "model"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string"
        },
        "gateway_id": {
          "type": "string"
        },
        "model": {
          "type": "string",
          "default": "@cf/openai/whisper-large-v3-turbo"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "base_url": {
          "type": "string",
          "description": "Optional deployment-owned full native endpoint override."
        },
        "language_code": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        }
      }
    },
    "ConstrainedGenerationBatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "max_items_per_call": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 8
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 65536
        }
      }
    },
    "ConstrainedGeneratorProducerConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generator",
        "output_schema"
      ],
      "properties": {
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output_schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON schema enforced before artifact publication. Unsupported schema vocabulary fails admission. Invalid or missing batch items receive one validation retry; successful siblings are retained."
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        }
      }
    },
    "ConstrainedOutput": {
      "type": "string",
      "enum": [
        "auto",
        "tool_call",
        "json_schema",
        "grammar"
      ],
      "default": "auto",
      "description": "Provider and model admission selects a supported constrained mechanism. Auto prefers forced tools, then provider JSON schema, then native grammar. Free-text parsing is not a mode."
    },
    "ConstrainedProbabilities": {
      "type": "string",
      "enum": [
        "token_logprobs",
        "verdict_only"
      ],
      "default": "token_logprobs",
      "description": "Token probabilities require complete decoder evidence for the allowed values. Verdict-only is explicit opt-in; model-reported confidence is never used."
    },
    "DocumentExtractionConfig": {
      "type": "object",
      "description": "Configuration for the `document_extraction` producer. It downloads the source URL and persists derived units such as PDF pages, sections, images, and audio.\n\nNative text (PDF text layers, Office documents, HTML, email, plain text) is extracted with no model. Scanned pages and images are read only when `ocr` names a reader or generator, and audio is transcribed only when `transcription` names a transcriber. Units that need a producer that is not configured report `extraction_status` `ocr_not_configured` or `transcription_not_configured`.\n\n**Example:**\n```json\n{\n  \"source\": {\"filename_field\": \"filename\", \"content_type_field\": \"mime_type\"},\n  \"ocr\": {\"reader\": {\"provider\": \"antfly\", \"model\": \"lightonai/LightOnOCR-3-0.8B\"}},\n  \"transcription\": {\"transcriber\": {\"provider\": \"antfly\", \"model\": \"openai/whisper-small\"}}\n}\n```",
      "properties": {
        "source": {
          "$ref": "#/$defs/DocumentExtractionSourceConfig"
        },
        "filename": {
          "type": "string",
          "description": "Static filename used for content detection when the row has none."
        },
        "content_type": {
          "type": "string",
          "description": "Static content type. Overrides the downloaded response's content type."
        },
        "etag": {
          "type": "string",
          "description": "Static ETag recorded as source version metadata."
        },
        "checksum": {
          "type": "string",
          "description": "Static checksum recorded as source version metadata."
        },
        "version": {
          "type": "string",
          "description": "Static source version. Together with the other metadata it lets extraction skip unchanged sources."
        },
        "last_modified": {
          "type": "string",
          "description": "Static last-modified timestamp recorded as source version metadata."
        },
        "credentials": {
          "type": "string",
          "description": "Credential reference used to download the source URL."
        },
        "html_strip_tags": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "Strip HTML markup from HTML sources before storing their text."
        },
        "ocr": {
          "$ref": "#/$defs/DocumentExtractionOcrConfig"
        },
        "transcription": {
          "$ref": "#/$defs/DocumentExtractionTranscriptionConfig"
        },
        "route_preset": {
          "type": "string",
          "enum": [
            "mixed_files",
            "explicit_only"
          ],
          "default": "mixed_files",
          "description": "How sources that match no explicit route are handled. `mixed_files` (alias `default`) detects PDFs, HTML, email, Office documents, ZIP archives, images, audio, and text. `explicit_only` (alias `none`) records unmatched sources as unsupported. Detection never requests a producer: detected images and audio without a configured producer report `ocr_not_configured` or `transcription_not_configured`."
        },
        "routes": {
          "type": "array",
          "description": "Routes evaluated in order before the preset. The first route whose match applies selects the extractor.",
          "items": {
            "$ref": "#/$defs/DocumentExtractionRoute"
          }
        }
      }
    },
    "DocumentExtractionOcrConfig": {
      "type": "object",
      "description": "Reads scanned pages and images. Name exactly one of `reader` or `generator`. Readers run their own OCR task; generators receive a transcription instruction.",
      "x-antfly-exactly-one-of": [
        "reader",
        "generator"
      ],
      "properties": {
        "reader": {
          "$ref": "#/$defs/DocumentExtractionReaderConfig"
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "mode": {
          "type": "string",
          "enum": [
            "auto",
            "always"
          ],
          "default": "auto",
          "description": "`auto` reads PDF pages whose native text fails the `quality` checks, and images. `always` reads every page."
        },
        "prompt": {
          "type": "string",
          "description": "Overrides the OCR prompt. Omit it to let the reader run its own OCR task. Apple readers reject prompts."
        },
        "render": {
          "$ref": "#/$defs/DocumentExtractionRenderConfig"
        },
        "quality": {
          "$ref": "#/$defs/DocumentExtractionOcrQualityConfig"
        }
      }
    },
    "DocumentExtractionOcrQualityConfig": {
      "type": "object",
      "description": "Thresholds that decide when a PDF page's native text is too poor to keep, in `auto` mode.",
      "properties": {
        "min_content_chars": {
          "type": "integer",
          "x-go-type-skip-optional-pointer": false,
          "minimum": 0,
          "default": 50,
          "description": "Pages with fewer meaningful characters are read with OCR."
        },
        "garbled_min_words": {
          "type": "integer",
          "x-go-type-skip-optional-pointer": false,
          "minimum": 0,
          "default": 20,
          "description": "Minimum words before the garbled-text check applies."
        },
        "garbled_sample_words": {
          "type": "integer",
          "minimum": 1,
          "default": 50,
          "description": "Words sampled by the garbled-text check."
        },
        "max_single_char_word_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.4,
          "description": "Maximum ratio of single-character words before text counts as garbled."
        },
        "substantial_line_min_chars": {
          "type": "integer",
          "minimum": 1,
          "default": 15,
          "description": "Minimum characters for a line to count in the corrupted-line check."
        },
        "max_corrupted_line_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.2,
          "description": "Maximum ratio of corrupted lines."
        },
        "font_corruption_score_threshold": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.5,
          "description": "Font corruption score at which text is replaced by OCR."
        },
        "max_replacement_char_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.05,
          "description": "Maximum ratio of Unicode replacement characters."
        }
      }
    },
    "DocumentExtractionReaderConfig": {
      "type": "object",
      "required": [
        "provider"
      ],
      "description": "Reader provider for OCR. Every provider except `apple` requires `model`; Apple uses Vision text recognition and accepts no model, credentials, or prompt.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly",
            "openai",
            "cloudflare",
            "vertex",
            "apple"
          ]
        },
        "model": {
          "type": "string",
          "description": "Reader model, such as `lightonai/LightOnOCR-3-0.8B`."
        },
        "prompt": {
          "type": "string",
          "description": "Provider-level prompt. Hosted readers send their own read instruction when it is omitted."
        },
        "max_tokens": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Maximum output tokens per page."
        },
        "api_url": {
          "type": "string",
          "description": "Reader endpoint URL."
        },
        "url": {
          "type": "string",
          "description": "Reader endpoint URL; takes precedence over `api_url`."
        },
        "base_url": {
          "type": "string",
          "description": "Provider API base URL."
        },
        "api_key": {
          "type": "string",
          "description": "API key, normally a `${secret:...}` reference."
        },
        "bearer_token": {
          "type": "string",
          "description": "Bearer token, normally a `${secret:...}` reference."
        },
        "capability_token": {
          "type": "string",
          "description": "Capability token for an Antfly inference endpoint."
        },
        "capability_revision": {
          "type": "string",
          "description": "Revision of the capability token."
        },
        "account_id": {
          "type": "string",
          "description": "Cloudflare account ID. Required for `cloudflare`."
        },
        "gateway_id": {
          "type": "string",
          "description": "Cloudflare AI Gateway ID."
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project for `vertex`."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud location for `vertex`."
        },
        "credentials_path": {
          "type": "string",
          "description": "Path to Google Cloud credentials for `vertex`."
        },
        "recognition_languages": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "type": "string"
          },
          "description": "Apple Vision recognition languages. Defaults to `en-US`."
        },
        "recognition_level": {
          "type": "string",
          "enum": [
            "accurate",
            "fast"
          ],
          "default": "accurate",
          "description": "Apple Vision recognition level."
        },
        "uses_language_correction": {
          "type": "boolean",
          "default": false,
          "description": "Apple Vision language correction."
        }
      }
    },
    "DocumentExtractionRenderConfig": {
      "type": "object",
      "description": "How PDF pages are rasterized for OCR.",
      "properties": {
        "dpi": {
          "type": "integer",
          "minimum": 72,
          "maximum": 600,
          "default": 150,
          "description": "Render resolution in dots per inch."
        },
        "resolution": {
          "type": "string",
          "enum": [
            "requested_dpi",
            "model_input"
          ],
          "default": "requested_dpi",
          "description": "`requested_dpi` renders at `dpi` within the caps. `model_input` renders near the model's preferred input size."
        },
        "max_pixels": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 100000000,
          "default": 40000000,
          "description": "Maximum pixels per rendered page."
        },
        "max_dimension": {
          "type": "integer",
          "minimum": 512,
          "maximum": 16384,
          "default": 4096,
          "description": "Maximum width or height of a rendered page."
        }
      }
    },
    "DocumentExtractionRoute": {
      "type": "object",
      "required": [
        "extractor"
      ],
      "properties": {
        "match": {
          "$ref": "#/$defs/DocumentExtractionRouteMatch"
        },
        "extractor": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "pdf",
                "html",
                "text",
                "email",
                "docx",
                "pptx",
                "xlsx",
                "archive",
                "ocr",
                "image",
                "audio",
                "transcript",
                "unsupported"
              ],
              "description": "Extractor for matching sources. `image` is an alias of `ocr` and `transcript` of `audio`. An `ocr` route requires an `ocr` block and an `audio` route requires a `transcription` block; otherwise the configuration is rejected with `DocumentExtractionModelRequired`."
            },
            "unit": {
              "type": "string",
              "description": "Unit type recorded for the extracted units, such as `page` or `transcript_segment`."
            }
          }
        }
      }
    },
    "DocumentExtractionRouteMatch": {
      "type": "object",
      "description": "Conditions a source must meet. Every condition given must match.",
      "properties": {
        "content_type": {
          "type": "string",
          "description": "Exact content type."
        },
        "content_type_prefix": {
          "type": "string",
          "description": "Content type prefix, such as `image/`."
        },
        "extension": {
          "description": "Filename extension or list of extensions.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "magic_prefix": {
          "description": "Leading bytes or list of leading-byte prefixes.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      }
    },
    "DocumentExtractionSourceConfig": {
      "type": "object",
      "description": "Names of row fields that carry source metadata. Each overrides the matching static field.",
      "properties": {
        "filename_field": {
          "type": "string",
          "description": "Row field holding the source filename."
        },
        "content_type_field": {
          "type": "string",
          "description": "Row field holding the source content type."
        },
        "etag_field": {
          "type": "string",
          "description": "Row field holding the source ETag."
        },
        "checksum_field": {
          "type": "string",
          "description": "Row field holding the source checksum."
        },
        "version_field": {
          "type": "string",
          "description": "Row field holding the source version."
        },
        "last_modified_field": {
          "type": "string",
          "description": "Row field holding the source last-modified timestamp."
        }
      }
    },
    "DocumentExtractionTranscriptionConfig": {
      "type": "object",
      "required": [
        "transcriber"
      ],
      "description": "Transcribes audio units.",
      "properties": {
        "transcriber": {
          "$ref": "#/$defs/STTConfig"
        }
      }
    },
    "EnrichmentConfig": {
      "type": "object",
      "description": "Inline managed enrichment definition. Enrichments materialize generated artifacts before indexing and may target source rows or previously generated artifact streams.",
      "required": [
        "name",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Stable generated artifact name."
        },
        "kind": {
          "$ref": "#/$defs/EnrichmentKind"
        },
        "source": {
          "$ref": "#/$defs/GroupedArtifactSource",
          "description": "Required for kind=group. The covering membership index and ordinary unit artifacts are maintained from source row commits."
        },
        "prior_context": {
          "$ref": "#/$defs/PriorArtifactContext",
          "description": "Bounded earlier-segment context from an artifact sharing the same grouped source. Only valid for prompt-consuming asset producers."
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Source field to read from the source document or source artifact payload."
        },
        "template": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Optional template for generated text input."
        },
        "source_artifact_name": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Existing artifact stream this enrichment consumes. Chunk enrichments may consume asset artifacts; embedding enrichments may consume chunk artifacts; asset enrichments may consume other asset artifacts (the upstream asset's produced bytes become this producer's source, so field and template must be omitted and the producer must consume text: copy, generator, or extractor)."
        },
        "expected_dims": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Expected embedding dimension for embedding enrichments."
        },
        "vector_space": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "description": "Optional stable model/token-space identifier for embedding artifacts. When omitted on every source, Antfly requires the effective producers to be semantically equivalent. To combine intentionally compatible but distinct producers, set the same identifier on every source. Explicit and implicit modes cannot be mixed; dimensions are always validated independently."
        },
        "chunk_size": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Chunk size for chunk enrichments."
        },
        "chunk_overlap": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Chunk overlap for chunk enrichments."
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig",
          "description": "Chunker configuration for chunk enrichments. Cannot be combined with chunker_json."
        },
        "chunker_json": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the typed chunker field.",
          "description": "Legacy serialized chunker configuration for chunk enrichments. Cannot be combined with chunker."
        },
        "full_text_index": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "When true on a chunk or asset enrichment, route generated text into the table's default full-text index."
        },
        "content_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Produced asset content type for asset enrichments."
        },
        "producer": {
          "allOf": [
            {
              "$ref": "#/$defs/EnrichmentProducerConfig"
            }
          ],
          "writeOnly": true,
          "description": "Write-only producer configuration. Cannot be combined with producer_json or transcriber. Decision producers use type=decision and config={version, decider, questions}. A named-embedder similarity decider also requires embedders={name: frozen EmbedderConfig}; the dependency travels with the specification for deterministic replay instead of resolving mutable node configuration. Credentials use secret references or environment defaults. Outputs include answers, usage, resolved model, specification hash, version, and source fingerprint. Change version or specification to rebuild through the enrichment lifecycle."
        },
        "producer_json": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "writeOnly": true,
          "deprecated": true,
          "x-deprecated-reason": "Use the producer field.",
          "description": "Write-only serialized producer configuration. For managed embedding enrichments Antfly stores a canonical semantic producer identity here; credentials and execution policy are excluded."
        },
        "neighbor_context": {
          "$ref": "#/$defs/EnrichmentNeighborContextConfig",
          "description": "Optional bounded sample of the document's graph neighbors appended to the producer input. Only valid on asset enrichments whose producer consumes rendered prompt text (generator, extractor, or decision); producers that treat the source as a media locator (copy, reader, transcriber, document_extraction) reject it. Only same-shard graph state is sampled; a graph index without local state for a document yields empty neighbors at runtime while the graph index reference itself is validated at admission."
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Non-semantic execution policy for this enrichment producer. This does not participate in generated artifact identity."
        },
        "transcriber": {
          "$ref": "#/$defs/TranscriberEnrichmentConfig",
          "description": "Typed shorthand for a transcription asset enrichment. Only valid with kind=asset and without producer_json; Antfly expands it into a document_extraction producer whose audio route transcribes each recording with this speech-to-text provider. The produced units carry the transcript text, provider confidence, and per-phrase time offsets, and chunk enrichments that consume them emit _start_time_ms/_end_time_ms on every chunk. With diarization: true the phrases also carry who spoke them, and a chunk that does not straddle a turn emits _speaker. content_type defaults to application/json."
        }
      }
    },
    "EnrichmentKind": {
      "type": "string",
      "enum": [
        "chunk",
        "asset",
        "embedding",
        "group"
      ],
      "description": "Managed generated artifact kind."
    },
    "EnrichmentNeighborContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "graph_index"
      ],
      "description": "Bounded sample of the document's same-shard graph neighbors appended to an asset producer's rendered input as a compact JSON block ({\"neighbors\":[{\"edge_type\":...,\"direction\":...,\"target\":...,\"weight\":...}]}), ordered by edge type then target key. A conceptualizer enrichment on an entities table can thereby ground its abstractions in adjacent facts (\"started_by -> John Andrew Rice\"). The sampled block participates in the producer's skip state, so a changed adjacency re-runs the producer.",
      "properties": {
        "graph_index": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a graph index on the same table whose local state is sampled. Validated at admission; cross-shard neighbors are not sampled."
        },
        "edge_types": {
          "x-go-type-skip-optional-pointer": true,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Edge types to sample. Empty admits every edge type."
        },
        "direction": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "out",
            "in",
            "both"
          ],
          "default": "both",
          "description": "Adjacency orientation to sample relative to the document."
        },
        "limit": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64,
          "default": 8,
          "description": "Maximum neighbors rendered into the producer input, applied after deterministic ordering."
        }
      }
    },
    "EnrichmentProducerConfig": {
      "type": "object",
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "copy",
            "generator",
            "extractor",
            "decision",
            "reader",
            "transcriber",
            "document_extraction",
            "vector_labels",
            "media_output"
          ]
        },
        "config": {
          "description": "Producer-specific configuration. Generator schemas and generated extractors share constrained output admission, batching, validation retry, and immutable artifact replay.",
          "anyOf": [
            {
              "$ref": "#/$defs/ConstrainedGeneratorProducerConfig"
            },
            {
              "$ref": "#/$defs/GeneratedExtractorConfig"
            },
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "$ref": "#/$defs/VectorLabelsConfig"
            },
            {
              "$ref": "#/$defs/MediaOutputConfig"
            },
            {
              "$ref": "#/$defs/DocumentExtractionConfig"
            }
          ]
        }
      }
    },
    "ExecutionPolicy": {
      "type": "object",
      "additionalProperties": false,
      "description": "Non-semantic execution policy for one producer or index maintenance operation. These fields tune how work is batched and do not change generated artifact identity.",
      "properties": {
        "batch_items": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Maximum items to process in one batch for this operation."
        },
        "batch_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint64",
          "description": "Approximate maximum source bytes to process in one batch for this operation."
        },
        "max_document_pages": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint32",
          "description": "Maximum PDF pages admitted for one request-atomic document operation."
        }
      }
    },
    "ExtractionAttributeGroup": {
      "type": "object",
      "required": [
        "labels"
      ],
      "properties": {
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "multi_label": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "applies_to": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "qualify_labels": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        }
      },
      "additionalProperties": false,
      "description": "Version 2 attributes are scored on retained entity spans using shared encoded states. Omitted applies_to selects all entities; [] selects none. Raw labels must be unique across groups, including when qualify_labels is true. Group names text,confidence,start,end are reserved."
    },
    "ExtractionClassificationConstraint": {
      "x-zig-type": "std.json.Value",
      "description": "Declarative, bounded constraint AST. Task and label references are validated before inference. Nesting is bounded by the server schema limit.",
      "oneOf": [
        {
          "$ref": "#/$defs/ExtractionConstraintLabelRef"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnySelected"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnyOtherSelected"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintIsDefault"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintCardinality"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintMinLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintMaxLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAtLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintNot"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnd"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintOr"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintExactlyOneOf"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintImplies"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintIff"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintExcludes"
        }
      ]
    },
    "ExtractionClassificationExample": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "input",
            "label"
          ],
          "properties": {
            "input": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "string"
          },
          "description": "A two-string [input,label] pair."
        }
      ]
    },
    "ExtractionClassificationSchema": {
      "type": "object",
      "required": [
        "name",
        "labels"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "multi_label": {
          "type": "boolean",
          "description": "The server uses false when omitted. Version 1: return highest-ranked labels up to top_k when false, or labels meeting options.threshold when true. Version 2: selects ordinary single or multi classification unless mode is specified; classification.threshold controls the decision threshold."
        },
        "hypothesis_template": {
          "type": "string",
          "description": "Version 1 NLI hypothesis template with {} as the label placeholder; the server uses \"This example is {}.\" when omitted. Version 2 GLiNER boundary extraction rejects an explicit hypothesis_template; use prompt/instruction and label_definitions for model conditioning."
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum labels for ordinary single-label classification; the server uses 1 when omitted. Version 2 constrained classification uses min_labels/max_labels. Advanced set-selection options or cross-task constraints on any classification in the collection reject every explicit top_k in that collection, including 1. Omit top_k when using these options."
        },
        "mode": {
          "type": "string",
          "enum": [
            "single",
            "multi"
          ],
          "description": "Version 2 ordinary classification mode. Standalone ordinal scores use the decision API.\nEach model rejects modes it does not support.\n",
          "x-go-type-skip-optional-pointer": false
        },
        "label_definitions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionLabelDefinition"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "min_labels": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "max_labels": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "x-go-type": "stdjson.RawMessage",
          "x-go-type-import": {
            "path": "encoding/json",
            "name": "stdjson"
          },
          "description": "Version 2 maximum selected labels. Explicit null means no maximum; omission preserves mode defaults."
        },
        "ordered": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "activation": {
          "type": "string",
          "enum": [
            "auto",
            "sigmoid",
            "softmax"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "temperature": {
          "type": "number",
          "format": "double",
          "x-go-type-skip-optional-pointer": false,
          "exclusiveMinimum": 0
        },
        "default": {
          "type": "string",
          "description": "Version 2 fallback label; must be declared in labels.",
          "x-go-type-skip-optional-pointer": false
        },
        "prompt": {
          "type": "string",
          "description": "Version 2 model-facing task instruction. Mutually exclusive with instruction.",
          "x-go-type-skip-optional-pointer": false
        },
        "instruction": {
          "type": "string",
          "description": "Alias of prompt.",
          "x-go-type-skip-optional-pointer": false
        }
      }
    },
    "ExtractionClassificationThreshold": {
      "type": "number",
      "format": "double",
      "x-go-type-skip-optional-pointer": false,
      "description": "Finite centered-logit decisions require a threshold strictly between zero and one.",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1
    },
    "ExtractionConstraintAnd": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "And"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAnyOtherSelected": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AnyOtherSelected"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAnySelected": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AnySelected"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAtLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AtLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintCardinality": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Cardinality"
          ]
        },
        "task": {
          "type": "string"
        },
        "minimum": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "maximum": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintExactlyOneOf": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ExactlyOneOf"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintExcludes": {
      "type": "object",
      "required": [
        "type",
        "left",
        "right"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Excludes"
          ]
        },
        "left": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "right": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintIff": {
      "type": "object",
      "required": [
        "type",
        "left",
        "right"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Iff"
          ]
        },
        "left": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "right": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintImplies": {
      "type": "object",
      "required": [
        "type",
        "cond",
        "then"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Implies"
          ]
        },
        "cond": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "then": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintIsDefault": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "IsDefault"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintLabelRef": {
      "type": "object",
      "required": [
        "type",
        "task",
        "label"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LabelRef"
          ]
        },
        "task": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintMaxLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintMinLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MinLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintNot": {
      "type": "object",
      "required": [
        "type",
        "child"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Not"
          ]
        },
        "child": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintOr": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Or"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionDecoderOptions": {
      "type": "object",
      "properties": {
        "algorithm": {
          "type": "string",
          "enum": [
            "auto",
            "exact",
            "beam"
          ],
          "description": "Omit to use the model's per-task default. GLiNER2.5 uses source-compatible beam selection for single-window JointIE and automatic selection for classification. Windowed JointIE uses the native automatic global solver with independent window resources. Explicit values select the native bounded search algorithm.",
          "x-go-type-skip-optional-pointer": false
        },
        "beam_width": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1024,
          "x-go-type-skip-optional-pointer": false
        },
        "max_search_nodes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200000,
          "x-go-type-skip-optional-pointer": false
        },
        "max_local_assignments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "x-go-type-skip-optional-pointer": false
        },
        "best_effort": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        }
      },
      "additionalProperties": false,
      "description": "Bounded classification and JointIE selection. Exact optimality is with respect to admitted candidates. A completed beam may be feasible without an optimality proof. By default exhausted search is an error; best_effort permits only a validated feasible witness and reports exhausted:true."
    },
    "ExtractionEntityDefinition": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "dtype": {
          "type": "string",
          "enum": [
            "str",
            "list"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "type": {
          "type": "string",
          "enum": [
            "str",
            "string",
            "list",
            "array"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "validators": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionRegexValidator"
          },
          "maxItems": 64,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraint": {
      "x-zig-type": "std.json.Value",
      "oneOf": [
        {
          "$ref": "#/$defs/ExtractionJointConstraintTypedEndpoints"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintNoSelfLoops"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintUniqueRelationPair"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintUniqueRelationSlot"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintEntityOverlapPolicy"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintMaxRelationsPerHead"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintMaxRelationsPerTail"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintSymmetricRelation"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintAcyclicRelation"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintInverseRelation"
        }
      ]
    },
    "ExtractionJointConstraintAcyclicRelation": {
      "type": "object",
      "required": [
        "type",
        "relation"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AcyclicRelation"
          ]
        },
        "relation": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintEntityOverlapPolicy": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "EntityOverlapPolicy"
          ]
        },
        "policy": {
          "type": "string",
          "enum": [
            "allow",
            "disallow",
            "nested"
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintInverseRelation": {
      "type": "object",
      "required": [
        "type",
        "relation",
        "inverse"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "InverseRelation"
          ]
        },
        "relation": {
          "type": "string"
        },
        "inverse": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintMaxRelationsPerHead": {
      "type": "object",
      "required": [
        "type",
        "limit"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxRelationsPerHead"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintMaxRelationsPerTail": {
      "type": "object",
      "required": [
        "type",
        "limit"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxRelationsPerTail"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintNoSelfLoops": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "NoSelfLoops"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintSymmetricRelation": {
      "type": "object",
      "required": [
        "type",
        "relation"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "SymmetricRelation"
          ]
        },
        "relation": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintTypedEndpoints": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TypedEndpoints"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "head_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "tail_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintUniqueRelationPair": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "UniqueRelationPair"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "directed": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintUniqueRelationSlot": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "UniqueRelationSlot"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "slot": {
          "type": "string",
          "enum": [
            "head",
            "tail",
            "slot"
          ],
          "default": "head",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointEntity": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "max_candidates": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "allow_nested": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointOptions": {
      "type": "object",
      "properties": {
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "entity_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "relation_role_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "top_k_entities": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "top_k_roles": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "x-go-type-skip-optional-pointer": false
        },
        "relation_pair_cap": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "max_edges_per_type": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "entity_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "relation_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "JointIE proposal admission and utility calibration. Entity candidate caps are bypassed for endpoints of retained relation proposals, subject to server hard bounds. entity_threshold overrides candidate admission, not entity decision thresholds."
    },
    "ExtractionJointRelation": {
      "type": "object",
      "required": [
        "head",
        "tail"
      ],
      "properties": {
        "head": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "tail": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "description": {
          "type": "string",
          "description": "Retained declarative metadata; model conditioning follows the pinned JointIE compiler.",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "directed": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        },
        "symmetric": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "inverse": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "allow_self": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "max_per_head": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "max_per_tail": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointSchema": {
      "type": "object",
      "required": [
        "entities"
      ],
      "properties": {
        "entities": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 128,
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/ExtractionJointEntity"
              }
            ]
          }
        },
        "relations": {
          "type": "object",
          "maxProperties": 32,
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionJointRelation"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "constraints": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionJointConstraint"
          },
          "maxItems": 512,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "Separate typed graph schema, mutually exclusive with ordinary extraction families. Hard typed endpoints, overlap, uniqueness and declared graph constraints apply to every returned edge, including derived companions."
    },
    "ExtractionLabelDefinition": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "Model-facing label description.",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionLongDocumentOptions": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "reject",
            "window"
          ],
          "default": "reject",
          "x-go-type-skip-optional-pointer": false
        },
        "window_words": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "x-go-type-skip-optional-pointer": false,
          "description": "Maximum body words per window; also bounded by the checkpoint and encoded token limits."
        },
        "overlap_words": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4095,
          "x-go-type-skip-optional-pointer": false
        },
        "max_windows": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "record_identity": {
          "type": "string",
          "enum": [
            "occurrence",
            "semantic"
          ],
          "default": "occurrence",
          "description": "Identity of latent, anchorless and legacy records across windows. Occurrence uses exact source spans; semantic explicitly merges equal field values. Natural records always use their exact source anchor. This is independent of annotation occurrence_policy.",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "Version 2 never silently truncates. Reject is the default. Windowing requires an enabled runtime capability, reconstructs document-global offsets and revalidates all hard graph constraints after merging."
    },
    "ExtractionOffsetUnit": {
      "type": "string",
      "description": "Half-open offsets into the immutable caller text. Version 2 defaults to utf8_bytes. No normalization, lowercasing or synthetic suffix is included in these coordinates.",
      "enum": [
        "utf8_bytes",
        "unicode_codepoints",
        "utf16_codeunits"
      ]
    },
    "ExtractionOptions": {
      "type": "object",
      "properties": {
        "threshold": {
          "type": "number",
          "format": "float"
        },
        "flat_ner": {
          "type": "boolean"
        },
        "include_confidence": {
          "type": "boolean"
        },
        "include_spans": {
          "type": "boolean"
        },
        "word_splitter": {
          "type": "string",
          "enum": [
            "whitespace",
            "char"
          ],
          "description": "Version 2 source word splitting. char keeps ASCII alphanumeric and @._-+ runs together and splits other non-whitespace codepoints, preserving original source offsets. An input's options replace the shared options in full; omitted word_splitter uses whitespace. Explicit word_splitter is rejected by version 1.",
          "x-go-type-skip-optional-pointer": false
        },
        "overlap": {
          "type": "string",
          "enum": [
            "allow",
            "nested",
            "flat",
            "disallow",
            "longest"
          ],
          "description": "Version 2 overlap selection. flat/disallow prohibit overlap, nested permits containment, longest removes strictly contained spans.",
          "x-go-type-skip-optional-pointer": false
        },
        "offset_unit": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionOffsetUnit"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "long_document": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionLongDocumentOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "decoder": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionDecoderOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "joint_ie": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionJointOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "reader": {
          "$ref": "#/$defs/ExtractionReaderOptions"
        },
        "resolver": {
          "$ref": "#/$defs/ExtractionResolverOptions"
        }
      },
      "additionalProperties": true
    },
    "ExtractionProbability": {
      "type": "number",
      "format": "double",
      "minimum": 0,
      "maximum": 1,
      "x-go-type-skip-optional-pointer": false
    },
    "ExtractionReaderOptions": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "api_url": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "ExtractionRegexValidator": {
      "type": "object",
      "required": [
        "pattern"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "regex"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "pattern": {
          "type": "string",
          "maxLength": 4096
        },
        "mode": {
          "type": "string",
          "enum": [
            "full",
            "partial"
          ],
          "default": "full",
          "x-go-type-skip-optional-pointer": false
        },
        "exclude": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "flags": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false,
          "default": 2,
          "description": "Python-compatible regex flags supported by the active bounded validator engine; unsupported flags or syntax fail validation."
        }
      },
      "additionalProperties": false
    },
    "ExtractionRelationSchema": {
      "type": "object",
      "description": "Optional source and target labels constrain relation endpoints. A target requires a source.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "description": "Version 2 model-facing relation description.",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        }
      }
    },
    "ExtractionResolverOptions": {
      "type": "object",
      "description": "Optional cross-input entity and relation deduplication.",
      "properties": {
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "default": 0.85,
          "minimum": 0,
          "maximum": 1
        },
        "type_must_match": {
          "type": "boolean",
          "default": true
        },
        "min_entity_confidence": {
          "type": "number",
          "format": "float",
          "default": 0,
          "minimum": 0,
          "maximum": 1
        },
        "min_relation_confidence": {
          "type": "number",
          "format": "float",
          "default": 0,
          "minimum": 0,
          "maximum": 1
        },
        "deduplicate_relations": {
          "type": "boolean",
          "default": true
        },
        "track_provenance": {
          "type": "boolean",
          "default": true
        }
      }
    },
    "ExtractionSchema": {
      "type": "object",
      "description": "Version 1 selects one extraction family; entities may accompany relations.\nWith schema_version 2, entities, attributes, classifications, structures,\nand ordinary relations may share one encoded input. joint_ie is a separate,\nmutually exclusive typed graph schema. The version 2 compiler rejects\nunknown fields and validates all references before model execution.\n",
      "properties": {
        "entities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "relations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionRelationSchema"
          }
        },
        "classifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationSchema"
          }
        },
        "structures": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionStructureSchema"
          }
        },
        "entity_definitions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionEntityDefinition"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "entity_attributes": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionAttributeGroup"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "classification_constraints": {
          "type": "array",
          "maxItems": 512,
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "joint_ie": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionJointSchema"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": true
    },
    "ExtractionStructureField": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "str",
                "string",
                "list",
                "array",
                "text",
                "number",
                "date",
                "estimate"
              ]
            },
            "decimals": {
              "type": "integer",
              "minimum": 0,
              "maximum": 15,
              "description": "Decimal precision for compatible hosted number fields."
            },
            "unit": {
              "type": "string"
            },
            "min": {
              "type": "number",
              "description": "Minimum of a hosted estimate distribution."
            },
            "max": {
              "type": "number"
            },
            "step": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "enum": {
              "type": "array",
              "minItems": 2,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "dtype": {
              "type": "string",
              "enum": [
                "str",
                "list"
              ],
              "x-go-type-skip-optional-pointer": false
            },
            "choices": {
              "type": "array",
              "minItems": 2,
              "items": {
                "type": "string"
              },
              "x-go-type-skip-optional-pointer": false
            },
            "description": {
              "type": "string",
              "x-go-type-skip-optional-pointer": false
            },
            "threshold": {
              "allOf": [
                {
                  "$ref": "#/$defs/ExtractionProbability"
                }
              ],
              "x-go-type-skip-optional-pointer": false
            },
            "cardinality": {
              "type": "string",
              "enum": [
                "optional_one",
                "required_one",
                "zero_or_more",
                "one_or_more"
              ],
              "description": "Version 2 explicit cardinality. Required fields are validated after record assignment.",
              "x-go-type-skip-optional-pointer": false
            },
            "exclusive": {
              "type": "boolean",
              "description": "Version 2 field spans cannot be assigned to multiple record instances.",
              "x-go-type-skip-optional-pointer": false
            },
            "validators": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExtractionRegexValidator"
              },
              "x-go-type-skip-optional-pointer": false
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "ExtractionStructureSchema": {
      "type": "object",
      "required": [
        "fields"
      ],
      "properties": {
        "fields": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionStructureField"
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "natural",
            "latent",
            "anchorless"
          ],
          "description": "Version 2 record grouping. Omission preserves one-record extraction.",
          "x-go-type-skip-optional-pointer": false
        },
        "anchor": {
          "type": "string",
          "description": "Natural mode only; defaults to the first declared field.",
          "x-go-type-skip-optional-pointer": false
        },
        "occurrence_policy": {
          "type": "string",
          "enum": [
            "all",
            "first",
            "error_on_ambiguous",
            "latent_all"
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": true
    },
    "GeneratedExtractorConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "method",
        "generator",
        "schema"
      ],
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "generated"
          ]
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "schema": {
          "$ref": "#/$defs/ExtractionSchema"
        },
        "entity_definitions": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "probabilities": {
          "$ref": "#/$defs/ConstrainedProbabilities"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        },
        "options": {
          "$ref": "#/$defs/ExtractionOptions"
        }
      }
    },
    "GeneratorConfig": {
      "description": "A unified configuration for a generative AI provider.\n",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareGeneratorConfig"
            },
            {
              "$ref": "#/$defs/GoogleGeneratorConfig"
            },
            {
              "$ref": "#/$defs/VertexGeneratorConfig"
            },
            {
              "$ref": "#/$defs/BedrockGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AnthropicGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OllamaGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AntflyGeneratorConfig"
            },
            {
              "$ref": "#/$defs/ChatGPTGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenAIGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenRouterGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AppleGeneratorConfig"
            }
          ]
        },
        {
          "properties": {
            "max_image_input_tokens": {
              "x-go-type-skip-optional-pointer": false,
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "description": "Conservative input-token ceiling per image. Required for image calls when tokens_per_minute is configured; choose a bound valid for the model and image policy."
            },
            "rate_limit": {
              "x-go-type-skip-optional-pointer": false,
              "$ref": "#/$defs/RateLimitConfig"
            },
            "provider": {
              "$ref": "#/$defs/GeneratorProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "GeneratorProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "gemini",
        "vertex",
        "bedrock",
        "anthropic",
        "ollama",
        "openai",
        "chatgpt",
        "openrouter",
        "antfly",
        "apple"
      ],
      "description": "Generator providers implemented by Antfly's generation runtime."
    },
    "GoogleGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Google generative AI provider (Gemini).\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "gemini"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "The Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "The Google Cloud location (e.g., 'us-central1')."
        },
        "model": {
          "type": "string",
          "description": "The name of the generative model to use.",
          "default": "gemini-2.5-flash"
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Google API key."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Google API endpoint."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "GroupedArtifactSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "group_by",
        "order_by",
        "field"
      ],
      "properties": {
        "group_by": {
          "type": "string",
          "minLength": 1
        },
        "order_by": {
          "type": "string",
          "minLength": 1,
          "description": "Field containing an integer ordinal. Ties use the document key."
        },
        "segment_by": {
          "type": "string",
          "minLength": 1
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "filter": {
          "type": "object",
          "additionalProperties": true,
          "description": "Canonical row filter evaluated on the source projection."
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 32768,
          "description": "UTF-8 text bytes per unit, including joining newlines. An oversized single member fails explicitly."
        },
        "max_members": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 1024,
          "description": "Maximum members per unit; larger partitions emit multiple units."
        },
        "window_ordinals": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 128,
          "description": "Fixed ordinal cells bound repartitioning and incremental work for long groups."
        }
      }
    },
    "MediaChunkPolicy": {
      "type": "object",
      "description": "Semantic chunk policy. Execution batch size and queue depth are deliberately separate.",
      "properties": {
        "max_text_bytes": {
          "type": "integer",
          "minimum": 4,
          "maximum": 16777216,
          "default": 1048576,
          "description": "Explicit byte ceiling per text chunk, independently of the target tokenizer budget."
        },
        "target_tokens": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000,
          "default": 500
        },
        "overlap_tokens": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "default": 50
        },
        "window_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 32000000000
        },
        "overlap_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0
        },
        "step_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 1000000000
        },
        "video_hold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1,
          "default": 1,
          "x-go-type-skip-optional-pointer": false,
          "description": "Select the displayed picture at each video cadence target, including VFR holds. Zero retains at-or-after timestamp sampling."
        },
        "max_frames": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "default": 32
        },
        "tile_width": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_height": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_overlap": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "audio_speaker_turns": {
          "type": "boolean",
          "default": false,
          "description": "Split audio chunks at detected speaker transitions, additionally respecting the boundary model limits. Requires a diarization-enabled boundary target, zero overlap_ns and zero audio_pause_ns. The boundary diarization recipe participates in plan identity. Analysis runs even with execute=false because these boundaries depend on audio inference."
        },
        "audio_pause_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0,
          "description": "Optional minimum silence duration for choosing an earlier boundary; no samples are discarded."
        },
        "audio_pause_search_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 5000000000
        },
        "audio_silence_milli": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "default": 10,
          "description": "Absolute normalized PCM amplitude threshold in thousandths."
        }
      }
    },
    "MediaOutputConfig": {
      "type": "object",
      "required": [
        "output_name"
      ],
      "description": "Publish a named shared media-pass output as a derived asset, retaining source coordinates and output recipe identity.",
      "properties": {
        "output_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "OllamaGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Ollama generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ollama"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Ollama model to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Ollama API endpoint."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Ollama API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenAI generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openai"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the OpenAI model to use.",
          "default": "gpt-4.1"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenAI API endpoint."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenAI API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "max_completion_tokens": {
          "type": "integer",
          "minimum": 1,
          "description": "OpenAI completion budget, including visible output and reasoning tokens.\nUse for reasoning models instead of max_tokens; the two are mutually exclusive.\n"
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort",
          "description": "Optional reasoning effort. Supported values depend on the selected OpenAI model."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIReasoningEffort": {
      "type": "string",
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "OpenAI reasoning effort; model support varies. Omit to use the model default."
    },
    "OpenAISTTConfig": {
      "type": "object",
      "description": "Configuration for OpenAI STT (Whisper) provider.\n\nAPI key via `api_key` field or `OPENAI_API_KEY` environment variable.\n\n**Model:** whisper-1\n\n**Supported Formats:** mp3, wav, webm, ogg, flac (max 25MB)\n\n**Docs:** https://platform.openai.com/docs/guides/speech-to-text",
      "properties": {
        "model": {
          "type": "string",
          "default": "whisper-1",
          "description": "Whisper model to use."
        },
        "api_key": {
          "type": "string",
          "description": "OpenAI API key. Falls back to OPENAI_API_KEY environment variable."
        },
        "base_url": {
          "type": "string",
          "format": "uri",
          "description": "API base URL. Falls back to OPENAI_BASE_URL environment variable."
        }
      }
    },
    "OpenRouterGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenRouter generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openrouter"
          ]
        },
        "model": {
          "type": "string",
          "description": "The OpenRouter model identifier to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenRouter API endpoint.",
          "default": "https://openrouter.ai/api/v1"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenRouter API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "PriorArtifactContext": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact",
        "render"
      ],
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Artifact providing earlier items, including this producer's own artifact."
        },
        "render": {
          "type": "string",
          "minLength": 1,
          "description": "Template rendered for each prior item, newest first."
        },
        "max_items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 40
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "horizon_segments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 8,
          "description": "Earlier segments available for context and the maximum later segments invalidated at each affected position of an original source change. A move invalidates the old and new neighborhoods independently; recomputed outputs never extend either interval."
        }
      }
    },
    "RateLimitConfig": {
      "type": "object",
      "x-go-type-skip-optional-pointer": false,
      "additionalProperties": false,
      "description": "Outbound provider limits shared within one Antfly process by effective\nendpoint, operation, model, credential source, project and region/location.\nConflicting policies for an active scope are rejected. These limits do\nnot coordinate across replicas or infer the provider's account quota.\n",
      "properties": {
        "pacing": {
          "$ref": "#/$defs/RequestPacing",
          "description": "Request pacing mode. Defaults to token_bucket. Legacy flat embedder RPM with burst=1 uses completion pacing."
        },
        "requests_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295
        },
        "burst": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "default": 1
        },
        "tokens_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Conservative text budget: each HTTP attempt reserves its serialized\nUTF-8 body byte count plus the configured generation output cap.\nReservations are not refunded. A request larger than this budget\nis rejected. This is not provider billing token accounting; media\nrequests are not supported with this limit.\n"
        },
        "max_concurrency": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "Maximum in-flight HTTP attempts, held through response completion."
        }
      }
    },
    "RequestPacing": {
      "type": "string",
      "enum": [
        "token_bucket",
        "completion"
      ],
      "description": "token_bucket limits admission rate while allowing overlapping attempts.\ncompletion serializes attempts and waits one RPM interval after each\nattempt finishes, including streamed writes and transport failures.\nThis prevents delayed connection setup from compressing successful\nrequest spacing, at the cost of response latency plus one interval per\nrequest. Requires requests_per_minute and burst=1. Neither mode can\nguarantee zero upstream 429s or coordinate other processes.\n"
    },
    "STTConfig": {
      "description": "Unified configuration for an STT provider.\n\nSelect the provider type and configure provider-specific settings.\n\n**Supported Providers:**\n- `openai` - OpenAI Whisper (whisper-1)\n- `vertex` - Google Cloud Speech-to-Text (Vertex AI)\n- `antfly` - Antfly inference service (Whisper, Wav2Vec2, HuBERT)\n\n**Example:**\n```yaml\nprovider: antfly\napi_url: \"http://localhost:8080\"\nmodel: openai/whisper-base\n```",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareSTTConfig"
            },
            {
              "$ref": "#/$defs/OpenAISTTConfig"
            },
            {
              "$ref": "#/$defs/VertexSTTConfig"
            },
            {
              "$ref": "#/$defs/AntflySTTConfig"
            },
            {
              "$ref": "#/$defs/AppleSTTConfig"
            }
          ]
        },
        {
          "properties": {
            "provider": {
              "$ref": "#/$defs/STTProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "STTProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "openai",
        "vertex",
        "antfly",
        "apple"
      ],
      "description": "The STT provider to use."
    },
    "TextChunkOptions": {
      "type": "object",
      "description": "Options specific to text chunking.",
      "properties": {
        "target_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Target number of tokens per chunk."
        },
        "overlap_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Number of tokens to overlap between consecutive chunks. Helps maintain context across chunk boundaries. Only used by fixed-size chunkers."
        },
        "separator": {
          "type": "string",
          "description": "Separator string for splitting (e.g., '\\n\\n' for paragraphs). Only used by fixed-size chunkers."
        }
      }
    },
    "TranscriberEnrichmentConfig": {
      "description": "Speech-to-text provider for the `transcriber` enrichment shorthand.\n\nCarries the provider's STT configuration (`provider`, `model`, `api_url`, `api_key`, ...) plus the transcription options below. The fields are declared inline rather than composed from `STTConfig` so that a generated client can leave an option out: a composed schema makes a typed client serialize every field, and a `max_download_bytes` of zero would reject every recording.\n\n**Example:**\n```yaml\nname: call_transcripts\nkind: asset\nfield: recording_url\ntranscriber:\n  provider: antfly\n  model: openai/whisper-base\n  language_code: en\n  timestamps: true\n```",
      "type": "object",
      "required": [
        "provider"
      ],
      "properties": {
        "provider": {
          "$ref": "#/$defs/STTProvider"
        },
        "model": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Model name, as the provider names it (e.g. 'openai/whisper-base' for antfly, 'whisper-1' for openai)."
        },
        "api_url": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "format": "uri",
          "description": "Antfly inference API URL. Falls back to ANTFLY_INFERENCE_URL."
        },
        "base_url": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "format": "uri",
          "description": "OpenAI API base URL. Falls back to OPENAI_BASE_URL."
        },
        "api_key": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Provider API key. Falls back to the provider's environment variable."
        },
        "project_id": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Google Cloud project ID for the vertex provider. Falls back to GOOGLE_CLOUD_PROJECT."
        },
        "location": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Google Cloud location for the vertex provider."
        },
        "credentials_path": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Path to an ADC credential JSON file for the vertex provider. Falls back to the default ADC chain."
        },
        "language_code": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Spoken language hint (ISO 639-1, e.g. 'en'). Omit for automatic detection where the provider supports it."
        },
        "timestamps": {
          "x-go-type-skip-optional-pointer": false,
          "type": "boolean",
          "default": true,
          "description": "Request timestamped transcript segments so chunks carry recording offsets. Providers without segment timing return plain text."
        },
        "diarization": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "Request speaker labels on transcript segments where the provider supports them."
        },
        "max_download_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Largest recording fetched from a URL, in bytes. Defaults to 128 MiB, which covers a one hour voice memo or podcast."
        },
        "download_assets": {
          "type": "boolean",
          "default": false,
          "x-go-type-skip-optional-pointer": true,
          "description": "For Apple transcription, explicitly permit preparing and installing the selected on-device Speech assets."
        }
      }
    },
    "VectorLabelsConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "labels"
      ],
      "description": "Zero-shot label stage over accepted dense embedding artifacts. Label prompts use the source embedding producer; changing this vocabulary rebuilds labels without reading or decoding media. Scores are raw dot products, not probabilities. The asset enrichment must name a dense embedding enrichment in source_artifact_name.",
      "properties": {
        "labels": {
          "type": "array",
          "minItems": 1,
          "maxItems": 4096,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "label"
            ],
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536
              }
            }
          }
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 3
        },
        "min_score": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "VertexGeneratorConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Vertex AI generative models.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "vertex"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Vertex AI model to use.",
          "default": "gemini-2.5-flash"
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud region for Vertex AI API.",
          "default": "us-central1"
        },
        "credentials_path": {
          "type": "string",
          "writeOnly": true,
          "description": "Path to service account JSON key file."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "VertexSTTConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Speech-to-Text provider (Vertex AI).\n\nUses Application Default Credentials (ADC) for authentication.\n\n**Features:** Streaming, speaker diarization, automatic punctuation\n\n**Docs:** https://cloud.google.com/speech-to-text/docs",
      "properties": {
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID. Falls back to GOOGLE_CLOUD_PROJECT environment variable."
        },
        "location": {
          "type": "string",
          "default": "us-central1",
          "description": "Google Cloud location."
        },
        "credentials_path": {
          "type": "string",
          "description": "Path to an ADC credential JSON file (service-account, authorized-user, or external-account). Falls back to the default ADC chain."
        },
        "language_code": {
          "type": "string",
          "default": "en-US",
          "description": "Default language code (e.g., 'en-US', 'es-ES')."
        },
        "enable_automatic_punctuation": {
          "type": "boolean",
          "default": true,
          "description": "Enable automatic punctuation."
        },
        "use_enhanced": {
          "type": "boolean",
          "default": false,
          "description": "Use enhanced models for better accuracy (costs more)."
        },
        "model": {
          "type": "string",
          "description": "Recognition model (e.g., 'latest_long', 'telephony', 'medical_dictation')."
        }
      }
    }
  }
}