VpaMediatorService

Service responsible for interaction with one or more VPAs (voice personal assistants). Its role is to ensure that each VPA does not interfere with another and that commands to and from a VPA go to the right UI / VPA adaptation. A VPA frontend must use this service to interact with a VPA engine.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The active Template (if any) for each VPA known to the system that should be rendered by the UI.

Link copied to clipboard
abstract val activeVpa: VpaIdentifier?

The currently active VPA (that is, the VPA that is currently not idle) or null if all of the VPAs are idle.

Link copied to clipboard

The list of all the known VpaAlerts for each VPA known to the system.

Link copied to clipboard

The state of whether there are notifications pending for each VPA known to the system.

Link copied to clipboard

The authentication status of each VpaAvailabilityState.AVAILABLE VPA known to the system.

Link copied to clipboard

Indicates to clients whether each VPA known to the system is in a state that allows it to respond to API calls in this service. If the state is VpaAvailabilityState.AVAILABLE, then the client can check its other states such as the vpaAuthenticationStatus and vpaConversationStates to know that it can indicate to the end-user about, for example, whether they can log in or speak to the VPA.

Link copied to clipboard

The state of the conversational dialogue with the VPAs in the system. This indicates whether a VPA is speaking, listening, waiting for a response from the user etc.

Link copied to clipboard

The immutable properties of each VpaAvailabilityState.AVAILABLE VPA known to the system. These properties include details such as its identifier and the list of languages it supports.

Link copied to clipboard

The state of the VPA UI. This indicates whether the UI should be made visible or should be hidden.

Functions

Link copied to clipboard
abstract suspend fun hideVpaUi(vpaIdentifier: VpaIdentifier)

Request the VPA UI be hidden.

Link copied to clipboard
abstract suspend fun logIn(vpaIdentifier: VpaIdentifier, authenticationType: AuthenticationType? = null)

Request to start the authentication process for the specified VPA service.

Link copied to clipboard
abstract suspend fun logOut(vpaIdentifier: VpaIdentifier)

Request to log out of the specified VPA service.

Link copied to clipboard
abstract suspend fun onActiveTemplateCleared(vpaIdentifier: VpaIdentifier)

Notifies the VPA that the UI component visualizing the active template has been removed.

Link copied to clipboard
abstract suspend fun onCustomUiEvent(vpaIdentifier: VpaIdentifier, event: VpaMessage)

Notifies the VPA that a custom UI event occurred.

Link copied to clipboard
abstract suspend fun performAction(vpaIdentifier: VpaIdentifier, vpaAction: VpaAction)

Request to perform a VPA action.

Link copied to clipboard
abstract suspend fun removeAllAlerts(vpaIdentifier: VpaIdentifier)

Asks the VPA to clear all active and pending alerts.

Link copied to clipboard
abstract suspend fun startListening(vpaIdentifier: VpaIdentifier? = null)

Ask the VPA to start listening for audio. This should be called, for example, when the user wants to speak to the VPA and has indicated this by pressing a push-to-talk button.

Link copied to clipboard
abstract suspend fun stopActiveAlerts(vpaIdentifier: VpaIdentifier)

Asks the VPA to stop all the active alerts.

Link copied to clipboard
abstract suspend fun stopCurrentInteraction(vpaIdentifier: VpaIdentifier)

Ask the VPA to stop the current interaction (if any) and go back to its idle state.