@langwatch/scenario
    Preparing search index...

    Interface OpenAIRealtimeAgentAdapterInit

    interface OpenAIRealtimeAgentAdapterInit {
        apiKey?: string;
        instructions?: string;
        model?: string;
        role?: AgentRole;
        tools?: RealtimeToolDef[];
        url?: string;
        voice?: string;
        wsFactory?: (url: string, authHeader: string) => WebSocket;
    }
    Index
    apiKey?: string

    Explicit API key; falls back to process.env.OPENAI_REALTIME_API_KEY, then process.env.OPENAI_API_KEY. Realtime always connects directly to OpenAI, so keep a real provider key here when OPENAI_API_KEY holds a gateway virtual key.

    instructions?: string

    System instructions passed via session.update.

    model?: string

    Realtime model id. Defaults to OPENAI_REALTIME_MODEL.

    role?: AgentRole

    AGENT (default) makes the model the agent under test. USER turns it into the voice-enabled user simulator — scripted user("text") steps route through sendText and bypass the TTS pipeline.

    tools?: RealtimeToolDef[]

    Tool definitions passed straight through to the Realtime session.

    url?: string

    Override the Realtime endpoint URL. Defaults to wss://api.openai.com/v1/realtime?model=<model>. Lets tests point at a loopback WS server without subclassing the adapter.

    voice?: string

    Voice id (e.g. "alloy", "nova").

    wsFactory?: (url: string, authHeader: string) => WebSocket

    Optional factory that creates the WebSocket instead of new WebSocket(url, headers). Intended for testing — lets tests inject a fake WS without subclassing or monkey-patching. The factory receives the resolved URL and Authorization header value.