Base class for avatar plugin sessions.

Plugin implementations should extend this class and call super.start(agentSession, room) first in their own start() method. The base:

  • Registers AvatarSession.aclose as a job shutdown callback, so avatar resources are released when the job shuts down.
  • Warns when the avatar session is started after AgentSession.start — in that case the existing audio output will be replaced by the avatar's.

Hierarchy (view full)

Constructors

Methods

Constructors

Methods

  • Release any resources owned by this avatar session. Default implementation is a no-op; subclasses can override to perform cleanup.

    Returns Promise<void>

  • Start the avatar session.

    Subclasses should override this method and call super.start(agentSession, room) at the top of their implementation. Subclasses may widen the return type (e.g. returning a session id), matching the # type: ignore[override] escape hatch used in Python.

    Parameters

    • agentSession: AgentSession<unknown>
    • room: Room
    • Optional params: {
          livekitApiKey?: string;
          livekitApiSecret?: string;
          livekitUrl?: string;
      }
      • Optional livekitApiKey?: string
      • Optional livekitApiSecret?: string
      • Optional livekitUrl?: string

    Returns Promise<void>