{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/verbs/elevenlabs_s2s",
  "minVersion": "10.1.0",
  "title": "ElevenLabs S2S",
  "description": "Shortcut for 'llm' with vendor automatically set to 'elevenlabs'. Connects the caller to an ElevenLabs Conversational AI agent for real-time speech-to-speech voice conversation. Unlike other s2s vendors, ElevenLabs requires a pre-configured agent_id rather than a model and messages.",
  "type": "object",
  "allOf": [
    {
      "$ref": "../components/llm-base"
    }
  ],
  "properties": {
    "verb": {
      "const": "elevenlabs_s2s",
      "description": "The verb name."
    },
    "vendor": {
      "type": "string",
      "const": "elevenlabs",
      "description": "The LLM vendor (always 'elevenlabs' for this shortcut)."
    },
    "auth": {
      "type": "object",
      "description": "Authentication credentials for ElevenLabs. Requires agent_id; api_key is optional (if not provided, an unsigned URL is used).",
      "properties": {
        "agent_id": {
          "type": "string",
          "description": "The ElevenLabs Conversational AI agent ID. Required."
        },
        "api_key": {
          "type": "string",
          "description": "The ElevenLabs API key. Optional; when provided, a signed URL is used for the WebSocket connection."
        }
      },
      "required": [
        "agent_id"
      ]
    },
    "llmOptions": {
      "type": "object",
      "description": "Options for the ElevenLabs conversation session.",
      "properties": {
        "conversation_initiation_client_data": {
          "type": "object",
          "description": "Optional data sent to the agent when the conversation starts.",
          "additionalProperties": true
        },
        "input_sample_rate": {
          "type": "integer",
          "description": "Audio input sample rate in Hz.",
          "default": 16000
        },
        "output_sample_rate": {
          "type": "integer",
          "description": "Audio output sample rate in Hz.",
          "default": 16000
        }
      },
      "additionalProperties": true
    }
  },
  "required": [
    "auth"
  ],
  "examples": [
    {
      "verb": "elevenlabs_s2s",
      "auth": {
        "agent_id": "your-elevenlabs-agent-id",
        "api_key": "your-elevenlabs-api-key"
      },
      "llmOptions": {},
      "actionHook": "/s2s-complete",
      "eventHook": "/event",
      "events": [
        "all"
      ]
    }
  ]
}
