AIUserMessage

fun AIUserMessage(text: String, modifier: Modifier = Modifier, attachments: List<AIMessageAttachment> = emptyList(), onEdit: () -> Unit? = null, textStyle: TextStyle = MaterialTheme.typography.bodyLarge, colors: AIUserMessageColors = AIUserMessageDefaults.colors())

A message the person sent: its attachments, then its text in a bubble, at the end of the row. Pressing and holding the bubble offers to copy the text, and to edit it given onEdit.

AIUserMessage(text = message.text, onEdit = { composerState.edit(message) })

Each attachment shows through ChatAiComponentFactory.AIConversationAttachment, which renders AIMessageAttachmentItem by default.

Parameters

text

What the person wrote. Without it, only the attachments show.

modifier

The modifier to apply to the message.

attachments

What they sent with it, such as images and files.

onEdit

Edits the message, such as by putting its text back in the composer. Without it, the menu offers only to copy.

textStyle

The style of the text.

colors

The palette of the bubble.