MapGptCompose

Constructors

Link copied to clipboard
constructor()

Default constructor is used in the Compose Preview. You should get the instance through the Dash.mapGptCompose property.

Properties

Link copied to clipboard
val avatar: StateFlow<MapGptAvatar>

Surfaces the current avatar used to show the conversation states.

Link copied to clipboard

Surfaces the conversation state used to show the chat bubble.

Link copied to clipboard
val chatItems: StateFlow<List<ChatItem>>

Surfaces the current items used to show the conversation and action items.

Link copied to clipboard
val config: MutableStateFlow<MapGptComposeConfig>
Link copied to clipboard
val isAvailable: StateFlow<Boolean>

Surfaces if the MapGpt feature is available.

Link copied to clipboard
val isEnabled: StateFlow<Boolean>
Link copied to clipboard
val sessionError: StateFlow<Throwable?>

Surfaces a session error when there is one available. If there is no error, the value is null.

Link copied to clipboard
val sessionState: StateFlow<SessionState>

Surfaces the current MapGPT connection state.

Functions

Link copied to clipboard
fun attachContent(composeView: ComposeView, content: @Composable () -> Unit): MapGptDetachableUI

Apply the Mapbox styles to the provided ComposeView. This is often needed to use the Mapbox Compose components.

Link copied to clipboard
fun Avatar(modifier: Modifier = Modifier, onClick: () -> Unit = {}, mapGptAvatar: MapGptAvatar? = null)
Link copied to clipboard
fun ChatBubbleView(modifier: Modifier = Modifier)
Link copied to clipboard
fun ChatCarousel(modifier: Modifier = Modifier)

Default UI for the MapGPT carousel. This includes the chat bubble and clickable cards.

Link copied to clipboard

When building your own MapGPT UI, you should use this composable to connect the MapGPT state to your UI. This is also called in the default UI and is not required.

Link copied to clipboard
fun KeyboardModeButton(modifier: Modifier, onClick: () -> Unit)

Default UI used for opening the keyboard mode.

Link copied to clipboard
fun KeyboardModeExpanded(modifier: Modifier, onCloseClick: () -> Unit)

Default UI for the MapGPT chat with the keyboard feature.

Link copied to clipboard

Function to handle activating the voice assistant.

Link copied to clipboard

Function to handle the user selecting a card from the keyboard mode.

Link copied to clipboard
suspend fun onSendClicked(message: String)

Function to send a message through the keyboard mode.

Link copied to clipboard
fun PreviewTheme(content: @Composable () -> Unit)

Function that can be used to preview components.