Class InteractionManager

Manages interactions with the sandai iframe, including sending and stopping speech messages.

Constructors

Methods

Constructors

Methods

  • Cleans up all registered message event listeners previously added by _listenForMessage. Call this method when the instance is being destroyed or no longer needs to listen to messages.

    Returns void

  • Sends a message to make the character respond using the built-in LLM, and waits for a response.

    Parameters

    • message: string

      The message content the model responds to.

    • Optionalcontext: string

      Optional context for the model.

    Returns Promise<string>

    Resolves with the model's response.

  • Sends a message to make the character say something, and waits until speech has started.

    Parameters

    • message: string

      The message content to be spoken.

    Returns Promise<void>

    Resolves when the iframe signals that speech has started.

  • Sends a message to make the character stop speaking, and waits until speech has actually stopped.

    Returns Promise<void>

    Resolves when the iframe signals that speech has stopped.