Member Junction
    Preparing search index...

    Real-time, full-duplex driver for the ElevenLabs Agents Platform, implementing the Core BaseRealtimeModel primitive. Registers as ElevenLabsRealtime and is resolved for MJ: AI Models typed Realtime (API-key env alias: AI_VENDOR_API_KEY__ElevenLabsRealtime).

    Why an "agent", not a model: ElevenLabs realtime is an orchestrated STT→LLM→TTS stack exposed only through pre-configured server-side agents — there is no bare-model realtime socket. The driver hides that behind the standard realtime contract with a managed-agent strategy (ensureAgent):

    • params.Model starting with agent_ → used VERBATIM as a deployment-managed agent id.
    • any other value → the NAME of the driver-managed agent: find-by-name; create-if-missing (with the session's client-tool set and the prompt-override enablement that lets each session supply its own system prompt); PATCH when the order-insensitive tool fingerprint differs or the prompt override is not enabled. Results are instance-cached per name+tools.

    Per-session prompt authority stays with MJ: the managed agent stores only a placeholder prompt and explicitly enables conversation_config_override.agent.prompt.prompt; every session (server-bridged or client-direct) sends the real system prompt in its conversation_initiation_client_data frame.

    Topologies:

    No usage events: the Agents websocket reports no token usage; sessions never emit IRealtimeSession.OnUsage. Usage accounting for ElevenLabs realtime lives in the platform's own conversation dashboard / billing exports.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get apiKey(): string

      Only sub-classes can access the API key

      Returns string

    • get SupportedVoices(): RealtimeVoiceOption[]

      The provider-native voice ids this model can speak with (e.g. OpenAI alloy/echo/shimmer). The model/driver is the authoritative owner of "what voices do I support", so each driver declares its own — used to populate the dev voice picker. Default empty (a driver that hasn't declared voices yields no picker options, falling back to the configured/default voice).

      NOTE: this is the near-term, driver-owned source of truth. Long term this should move to metadata so providers that let users add their OWN voices (e.g. ElevenLabs) can be enumerated dynamically.

      Returns RealtimeVoiceOption[]

      The supported voice ids (id + human label), or [] when none are declared.

    • get SupportsClientDirect(): boolean

      ElevenLabs supports the client-direct topology natively: the signed websocket URL is a short-lived, agent-scoped credential the browser can open directly.

      Returns boolean

    • get SupportsVideo(): boolean

      Whether this driver's sessions carry a video track in addition to audio — i.e. the model accepts video input (it can "see" the user's camera) and/or emits video output (a talking-head avatar / generated video), in sync with audio.

      Defaults to false (audio-only — today's realtime models). Video-capable drivers (a native multimodal realtime model, or an avatar provider) override this to true. The session's media plane is media-tagged (IRealtimeSession.SendInput takes a RealtimeMediaKind; IRealtimeSession.OnVideoOutput delivers video-out), so a video session reuses the entire realtime contract — only the media frames gain a video kind. Resolution prefers a video-capable model when an agent requests video, and degrades to audio-only otherwise.

      Returns boolean

      true if sessions can carry video; false (audio-only) otherwise.

    Methods

    • Builds the create/update body for the managed agent: the placeholder base prompt, the session tool set mapped to inline CLIENT tools (expects_response: true so the agent blocks on — and then speaks — each result; max response timeout because MJ client tools delegate to long-running agents), and the platform-settings enablement of the per-session agent.prompt.prompt override.

      params.Config.llm (when a string) selects the agent's underlying LLM; all other provider-level agent settings are deployment concerns (use a verbatim agent id for full control).

      Parameters

      Returns BodyCreateAgentV1ConvaiAgentsCreatePost

    • REST seam: creates an agent, returning its id.

      Parameters

      • body: BodyCreateAgentV1ConvaiAgentsCreatePost

      Returns Promise<string>

    • Resolves params.Model to a concrete ElevenLabs agent id.

      • A verbatim agent id (agent_…) is returned as-is — the deployment owns that agent's configuration (including its tool set and override enablement).
      • Anything else is the MANAGED agent name: find-by-name → create-if-missing → PATCH when the order-insensitive client-tool fingerprint differs or the per-session prompt override is not enabled. The resolution is instance-cached per name + fingerprint.

      Parameters

      Returns Promise<string>

    • REST seam: mints the signed websocket URL for an agent (GET /v1/convai/conversation/get-signed-url?agent_id=… with the xi-api-key header — the SDK call below is that exact request).

      Parameters

      • agentId: string

      Returns Promise<string>

    • Whether the agent's platform settings enable the per-session system-prompt override.

      Parameters

      • agent: GetAgentResponseModel

      Returns boolean