@langwatch/scenario
    Preparing search index...

    Interface ElevenLabsAgentAdapterOptions

    interface ElevenLabsAgentAdapterOptions {
        agentId: string;
        apiKey: string;
        conversationClient?: ConversationClient;
        dynamicVariables?: Record<string, string | number | boolean>;
        firstMessageOverride?: string;
        overrides?: Record<string, unknown>;
        systemPromptOverride?: string;
        webSocketFactory?: WebSocketFactory;
    }
    Index
    agentId: string

    ID of the ElevenLabs Conversational AI agent (provisioned in the EL dashboard).

    apiKey: string

    ElevenLabs API key (xi-api-key).

    conversationClient?: ConversationClient

    SDK conversation client used ONLY for the requiresAuth signed-URL handshake — injected for unit tests so startSession() does not make a real getSignedUrl HTTP call. Production callers leave this unset; the adapter's authenticated ElevenLabsClient is used.

    dynamicVariables?: Record<string, string | number | boolean>

    Per-call dynamic variables, forwarded NATIVELY to ElevenLabs as the init handshake's dynamic_variables. EL personalizes a hosted agent per call from these: a call-init webhook keyed on e.g. a tenant/org id resolves that call's system prompt, first message, and task context.

    Values pass through with their native JSON type — Text (string), Numeric (number), or Boolean (boolean) — with NO String() coercion, matching EL's typed dynamic-variable support. A key whose value is undefined is dropped before sending (the JSON serializer omits it). When this option is unset the adapter sends no dynamic_variables at all (not an empty {}).

    Applied only if the agent is configured to allow it — EL ignores variables the agent has not declared (server-side allowlist).

    scenario.elevenLabsAgent({
    agentId, apiKey,
    dynamicVariables: { tenant_id: "acme", seat_tier: 2, is_vip: true },
    });
    firstMessageOverride?: string

    Per-session first message override (conversationConfigOverride.agent.first_message).

    overrides?: Record<string, unknown>

    Per-call conversation-config overrides, DEEP-merged into the init handshake's conversation_config_override. Use this for any override the narrow ElevenLabsAgentAdapterOptions.systemPromptOverride/ElevenLabsAgentAdapterOptions.firstMessageOverride knobs do not cover (e.g. { agent: { language: "es" }, tts: { stability: 0.3 } }).

    Merge + precedence: the caller's overrides are applied FIRST, then the narrow systemPromptOverride/firstMessageOverride are layered on top — so the narrow knobs take precedence over the same keys here (agent.prompt.prompt, agent.first_message), while the shared top-level agent key DEEP-merges so a caller's agent.language and the adapter's agent.prompt BOTH survive.

    Applied only if the agent is configured to allow it — EL ignores non-allowlisted overrides server-side.

    scenario.elevenLabsAgent({
    agentId, apiKey,
    overrides: { agent: { language: "es" }, tts: { stability: 0.3 } },
    });
    systemPromptOverride?: string

    Per-session system prompt override applied via the SDK's conversationConfigOverride.agent.prompt.prompt. Lets demos use a different prompt shape without mutating the shared test agent.

    webSocketFactory?: WebSocketFactory

    SDK WebSocket factory — injected for unit tests so the real Conversation runs against an in-memory socket (no network). Production callers leave this unset; the SDK's DefaultWebSocketFactory (the ws package) is used.