Documentation

Powered by Algolia

Sending data between the app and script

When you create a voice assistant with Alan, you may want your app to communicate with the voice script and send data to it. For example, it may be necessary to:

  • Pass the app state to the voice script so that Alan understands what page or screen is currently active and provides relevant responses
  • Send information from the app to the voice script
  • Perform some logic without a voice command, for example, play a message in response to user's actions in the app

In Alan, the app can send data to the voice script in the following ways:

  • With visual state: The visual state object lets you pass the current state of the app to the voice script. It can be helpful if you want to inform Alan about the current visual context to adjust the logic in the dialog flow, for example, filter out some voice commands, give responses applicable to the open page or screen and so on.
  • With project API: The project API has a more general usage scope. It can be helpful if you need to send some information to the voice script or perform actions (play messages, call functions, set variable values) without a voice command.