{
  "id": "__yao.semantic",
  "title": "Smart Text Splitting",
  "description": "AI-powered intelligent document splitting that understands content meaning and context. Uses large language models to split text at natural topic boundaries, preserving subject coherence and logical flow for better search retrieval quality.",
  "required": ["size", "overlap", "max_depth"],
  "properties": {
    "size": {
      "type": "integer",
      "title": "Segment Size",
      "description": "Target characters per text segment.",
      "default": 300,
      "minimum": 50,
      "maximum": 4000,
      "component": "InputNumber",
      "width": "half",
      "order": 1
    },
    "overlap": {
      "type": "integer",
      "title": "Overlap",
      "description": "Overlapping characters between adjacent segments.",
      "default": 50,
      "minimum": 0,
      "maximum": 1000,
      "component": "InputNumber",
      "width": "half",
      "order": 2
    },
    "max_depth": {
      "type": "integer",
      "title": "Max Depth",
      "description": "Maximum hierarchy depth to traverse for splitting.",
      "default": 3,
      "minimum": 1,
      "maximum": 10,
      "component": "InputNumber",
      "width": "half",
      "order": 3
    },
    "size_multiplier": {
      "type": "integer",
      "title": "Size Multiplier",
      "description": "Multiplier to adjust effective size at deeper levels.",
      "default": 3,
      "minimum": 1,
      "maximum": 10,
      "component": "InputNumber",
      "width": "half",
      "order": 4
    },
    "max_concurrent": {
      "type": "integer",
      "title": "Max Concurrent",
      "description": "Parallelism when splitting documents.",
      "default": 1,
      "minimum": 1,
      "maximum": "{{ $limit.max_concurrent }}",
      "component": "InputNumber",
      "width": "half",
      "order": 5
    },
    "semantic": {
      "type": "object",
      "title": "Semantic Options",
      "description": "Advanced options for semantic model calls.",
      "component": "Nested",
      "order": 6,
      "required": false,
      "requiredFields": ["connector", "context_size"],
      "properties": {
        "connector": {
          "type": "string",
          "title": "Connector",
          "description": "Connector ID for the AI model (e.g. openai.gpt-4o-mini, deepseek.v3).",
          "default": "",
          "component": "Select",
          "enum": [
            {
              "groupLabel": "OpenAI Models",
              "options": [
                {
                  "label": "GPT-4o Mini",
                  "value": "openai.gpt-4o-mini",
                  "description": "Fast and cost-effective, best for most use cases",
                  "default": true
                },
                {
                  "label": "GPT-4o",
                  "value": "openai.gpt-4o",
                  "description": "Highest quality AI splitting for complex documents"
                }
              ]
            },
            {
              "groupLabel": "Alternative Models",
              "options": [
                {
                  "label": "Deepseek V3",
                  "value": "deepseek.v3",
                  "description": "Cost-effective alternative with good performance"
                },
                {
                  "label": "Claude 3.5 Sonnet",
                  "value": "anthropic.claude-3-5-sonnet",
                  "description": "Excellent reasoning and context understanding"
                }
              ]
            }
          ],
          "width": "half",
          "order": 1
        },
        "toolcall": {
          "type": "boolean",
          "title": "Enable Tool Call",
          "description": "Allow tool calls during semantic analysis.",
          "default": false,
          "component": "Switch",
          "width": "half",
          "order": 2
        },
        "context_size": {
          "type": "integer",
          "title": "Context Size",
          "description": "Approximate characters provided to the model for context (defaults to size * 6).",
          "default": 1800,
          "minimum": 200,
          "maximum": 32000,
          "component": "InputNumber",
          "width": "half",
          "order": 3
        },
        "options": {
          "type": "string",
          "title": "Model Options (JSON)",
          "description": "Optional model-specific options in JSON string.",
          "default": "",
          "component": "CodeEditor",
          "width": "full",
          "order": 4
        },
        "prompt": {
          "type": "string",
          "title": "Custom Prompt",
          "description": "Override default prompting for semantic splitting.",
          "default": "",
          "component": "TextArea",
          "width": "full",
          "order": 5
        },
        "max_retry": {
          "type": "integer",
          "title": "Max Retry",
          "description": "Maximum retries for model calls.",
          "default": 3,
          "minimum": 0,
          "maximum": 10,
          "component": "InputNumber",
          "width": "half",
          "order": 6
        },
        "semantic_max_concurrent": {
          "type": "integer",
          "title": "Semantic Max Concurrent",
          "description": "Parallelism for semantic model calls.",
          "default": 1,
          "minimum": 1,
          "maximum": "{{ $limit.task.max_concurrent }}",
          "component": "InputNumber",
          "width": "half",
          "order": 7
        }
      }
    }
  }
}
