{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/components/recognizer-speechmaticsOptions",
  "title": "Speechmatics Recognizer Options",
  "description": "Speechmatics-specific STT options. Only applies when recognizer vendor is 'speechmatics'.",
  "type": "object",
  "properties": {
    "host": {
      "type": "string",
      "description": "Speechmatics host URL."
    },
    "profile": {
      "type": "string",
      "enum": ["adaptive", "agile", "smart", "external"],
      "description": "Speechmatics profile."
    },
    "transcription_config": {
      "type": "object",
      "description": "Speechmatics transcription configuration.",
      "properties": {
        "language": { "type": "string", "description": "Language code." },
        "domain": { "type": "string", "description": "Domain model." },
        "additional_vocab": { "type": "array", "description": "Additional vocabulary entries." },
        "diarization": { "type": "string", "description": "Diarization mode." },
        "speaker_diarization_config": {
          "type": "object",
          "properties": {
            "speaker_sensitivity": { "type": "number" },
            "max_speakers": { "type": "number" }
          }
        },
        "conversation_config": {
          "type": "object",
          "properties": {
            "end_of_utterance_silence_trigger": { "type": "number" }
          }
        },
        "enable_partials": { "type": "boolean", "description": "Enable partial transcripts." },
        "max_delay": { "type": "number", "description": "Maximum delay in seconds." },
        "max_delay_mode": {
          "type": "string",
          "enum": ["fixed", "flexible"],
          "description": "Delay mode."
        },
        "output_locale": { "type": "string", "description": "Output locale for formatting." },
        "punctuation_overrides": {
          "type": "object",
          "properties": {
            "permitted_marks": { "type": "array", "items": { "type": "string" } },
            "sensitivity": { "type": "number" }
          }
        },
        "operating_point": { "type": "string", "description": "Deprecated by Speechmatics in favor of 'model'. Operating point (standard or enhanced)." },
        "model": {
          "type": "string",
          "description": "Model selection (replaces operating_point), e.g. standard, enhanced, or melia-1."
        },
        "enable_entities": { "type": "boolean", "description": "Enable entity detection." },
        "audio_filtering_config": {
          "type": "object",
          "properties": {
            "volume_threshold": { "type": "number" }
          },
          "required": ["volume_threshold"]
        },
        "transcript_filtering_config": {
          "type": "object",
          "properties": {
            "remove_disfluencies": { "type": "boolean" },
            "replacements": {
              "type": "array",
              "description": "Word replacement rules applied to the transcript. 'from' accepts a plain word or a /regex/.",
              "items": {
                "type": "object",
                "properties": {
                  "from": { "type": "string" },
                  "to": { "type": "string" }
                },
                "required": ["from", "to"],
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        }
      }
    },
    "translation_config": {
      "type": "object",
      "description": "Speechmatics translation configuration.",
      "properties": {
        "target_languages": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Target languages for translation."
        },
        "enable_partials": { "type": "boolean", "description": "Enable partial translations." }
      },
      "required": ["target_languages"]
    },
    "audio_events_config": {
      "type": "object",
      "description": "Audio event detection configuration.",
      "properties": {
        "types": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["applause", "music", "laughter"]
          },
          "description": "Audio event types to detect."
        }
      }
    }
  },
  "additionalProperties": false
}
