{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/verbs/transcribe",
  "minVersion": "0.9.6",
  "title": "Transcribe",
  "description": "Enables real-time transcription of the call audio. Transcription results are sent to the transcriptionHook as they are produced. Runs as a background process — subsequent verbs execute immediately while transcription continues.",
  "type": "object",
  "properties": {
    "verb": {
      "const": "transcribe"
    },
    "id": {
      "type": "string",
      "description": "An optional unique identifier for this verb instance."
    },
    "enable": {
      "type": "boolean",
      "description": "Enable or disable transcription. Used when transcribe is nested inside a config or dial verb to start or stop background transcription."
    },
    "transcriptionHook": {
      "type": "string",
      "format": "uri",
      "description": "The webhook URL to receive transcription results."
    },
    "translationHook": {
      "type": "string",
      "format": "uri",
      "description": "The webhook URL to receive translated transcription results."
    },
    "recognizer": {
      "$ref": "../components/recognizer",
      "description": "STT configuration for the transcription."
    },
    "earlyMedia": {
      "type": "boolean",
      "description": "If true, begin transcribing before the call is answered."
    },
    "channel": {
      "type": "number",
      "enum": [1, 2],
      "description": "Specific audio channel to transcribe. Channel 1 = near-end (local party's audio, i.e. caller on A-leg or callee on B-leg). Channel 2 = far-end (remote party's audio). When transcribe is nested in the dial verb, omitting channel captures both legs mixed; specifying channel: 2 isolates the B-leg's inbound audio."
    }
  },
  "examples": [
    {
      "verb": "transcribe",
      "transcriptionHook": "https://myapp.example.com/transcription",
      "recognizer": {
        "vendor": "deepgram",
        "language": "en-US",
        "deepgramOptions": {
          "model": "nova-2",
          "smartFormatting": true
        }
      }
    }
  ]
}
