A Tavus avatar session.

Hierarchy (view full)

Constructors

Properties

conversationId: null | string = null

Accessors

Methods

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

    Returns Promise<void>

  • Set the avatar's facial emotion. The avatar keeps it until the next call; an unsupported emotion sets 'neutral'. Call it after waitForJoin(): an emotion sent before the avatar joins the room is dropped.

    Parameters

    • emotion: "neutral" | "happiness" | "sadness" | "anger" | "fear" | "surprise" | "disgust" | "contempt"

      The emotion to express, e.g. 'neutral', 'happiness', 'sadness'.

    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

    Returns Promise<void>

  • Wait until the avatar participant has joined the room and published its video track.

    Parameters

    • Optional timeout: {
          timeout?: null | number;
      }

      Timeout in milliseconds. Pass null to wait indefinitely.

      • Optional timeout?: null | number

    Returns Promise<void>