The job and environment context as seen by the agent, accessible by the entrypoint function.

Constructors

Accessors

  • get agent(): undefined | LocalParticipant
  • Returns undefined | LocalParticipant

    The agent's participant if connected to the room, otherwise undefined

Methods

  • Adds a promise to be awaited whenever a new participant joins the room.

    Parameters

    • callback: ((job, p) => Promise<void>)
        • (job, p): Promise<void>
        • Parameters

          Returns Promise<void>

    Returns void

    Throws

    FunctionExistsError if an entrypoint already exists

  • Adds a promise to be awaited when shutdown is called.

    Parameters

    • callback: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    Returns void

  • Connects the agent to the room.

    Parameters

    • Optional e2ee: E2EEOptions
    • autoSubscribe: AutoSubscribe = AutoSubscribe.SUBSCRIBE_ALL
    • Optional rtcConfig: RtcConfiguration

    Returns Promise<void>

    Remarks

    It is recommended to run this command as early in the function as possible, as executing it later may cause noticeable delay between user and agent joins.

    See

    @livekit/rtc-node for more information about the parameters.

  • Gracefully shuts down the job, and runs all shutdown promises.

    Parameters

    • reason: string = ''

      Optional reason for shutdown

    Returns void

  • Parameters

    • Optional identity: string

    Returns Promise<RemoteParticipant>