Member Junction
    Preparing search index...

    Real-time, full-duplex driver for the Inworld Realtime API, implementing the Core BaseRealtimeModel primitive. Registers as InworldRealtime and is resolved for MJ: AI Models typed Realtime (API-key env alias: AI_VENDOR_API_KEY__InworldRealtime).

    What the provider is: a single-WebSocket speech-to-speech stack. Sessions initialize with a session.update frame carrying model selection, instructions, audio settings, STT/TTS config, and tools; components are swappable mid-session without reconnect. Input is streamed audio (server-side STT with voice profiling); output is synthesized speech (Realtime TTS-2) supporting inline steering tags like [laugh]. Turn-taking is semantic VAD with adjustable eagerness, handling barge-in.

    Model resolution: Inworld brokers hundreds of LLMs; the reasoning model is selected via modelId (e.g. anthropic/claude-sonnet-4-6) carried from RealtimeSessionParams.Model (falling back to INWORLD_DEFAULT_MODEL_ID). STT engine and TTS voice are configured independently via Config.

    Topology: server-bridged only (StartSession) — the driver opens the WebSocket, sends the session config, and resolves only once the provider confirms the config is applied (driver obligation #7). Inworld does not expose a documented ephemeral-token mint for browser-direct sessions, so SupportsClientDirect stays false (inherited).

    Tool calling: "fluent tool calling" — functions declared at startup (or added mid-session via IRealtimeSession.RegisterTools) and executed mid-conversation; results fed back via IRealtimeSession.SendToolResult complete the loop.

    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

      Whether this driver can mint an ephemeral, server-scoped client credential for a client-direct realtime session (the browser opens its own provider socket using a short-lived token the server minted).

      Defaults to false. Providers that support browser-direct sessions override this to true and implement CreateClientSession. The server-bridged topology (where the provider socket lives on the server, via StartSession) is supported by every driver regardless of this flag.

      Returns boolean

      true if CreateClientSession is supported; false otherwise.

    • 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 authenticated WebSocket URL. Auth rides as a ?token= query parameter (the server-side API key for the server-bridged topology).

      Returns string

      The full wss://…?token=… connect URL.

      Wire-format binding point — confirm the auth query-parameter name (token) against a live Inworld endpoint; some deployments authenticate via an Authorization header instead.

    • Mints an ephemeral, server-scoped client credential plus a provider-native session config for a client-direct realtime session.

      In the client-direct topology the browser owns the provider socket (e.g. WebRTC), but the server still controls the prompt and tool set: it mints a short-lived token and hands back a ClientRealtimeSessionConfig whose SessionConfig the matching client driver applies when it opens its socket. This keeps prompt/tool authority server-side even though the media plane is client-direct.

      Not every provider supports this (some only expose a server-bridged socket), so this is a concrete method that throws by default rather than an abstract one — that would force every existing and future driver to implement it. Providers that support it override SupportsClientDirect to true and override this method.

      Parameters

      Returns Promise<ClientRealtimeSessionConfig>

      A promise resolving to the minted ClientRealtimeSessionConfig.

      Always, unless overridden by a provider that supports client-direct sessions.

    • Opens a server-bridged session: connects the realtime WebSocket authenticated with the API key, sends the full session config as the FIRST frame (session.update — model, instructions, audio/STT/TTS, tools, semantic-VAD turn-taking), and resolves only once the provider's session-ready confirmation arrives (driver obligation #7 — "ready only after the config is applied"). Mic frames sent before that would be dropped by the provider, and StartSession not resolving until ready makes that unrepresentable for consumers.

      Parameters

      • params: RealtimeSessionParams

        Session configuration (model, system prompt, tools, initial context, config bag).

      Returns Promise<IRealtimeSession>

      A promise resolving to the live IRealtimeSession handle, post-ready.