Actions
Actions are a way to interact with the assistant. When the user has prompted the assistant to do something, the AI can trigger an action. For example, you can ask the assistant to play music, or to stop the navigation, and more advanced cases like changing the temperature in the car. Mapbox continues to build out more actions and refine the existing ones.
Observing actions from events
See the Events API guide for more information on how to observe the SDK. There are many data points to observe while navigating to a destination.
Dash.controller.observeMapGptEvents().onEach { event ->
when (event) {
is DashMapGptEvent.PlayingMusic -> {
// Handle PlayingMusic event
}
is DashMapGptEvent.PausedMusic -> {
// Handle PausedMusic event
}
is DashMapGptEvent.ResumedMusic -> {
// Handle ResumedMusic event
}
}
}.launchIn(scope)
Definitions for the actions
These are just sample actions to demonstrate how they can be observed:
- Start Navigation: The assistant started the navigation to a destination.
- Stop Navigation: The assistant stops the current active guidance.
- Select Destination: The assistant selected a destination for navigation.
- PlayingMusic: The assistant started playing music.
- PausedMusic: The assistant paused the current track being played.
- ResumedMusic: The assistant resumed the paused track.
Was this page helpful?