PromptInput

@Composable
fun PromptInput(value: String, onValueChange: (String) -> Unit, onSubmit: () -> Unit, onStop: () -> Unit, busy: Boolean, modifier: Modifier = Modifier, placeholder: String = stringResource(R.string.ai_prompt_placeholder), attachments: List<FilePart> = emptyList(), onAddAttachment: () -> Unit? = null, onRemoveAttachment: (FilePart) -> Unit = {}, allowQueue: Boolean = false, onVoiceMode: () -> Unit? = null, toolbar: @Composable RowScope.() -> Unit = {})(source)

The composer (AI Elements <PromptInput>): a roomy rounded field with a toolbar row. The submit button morphs into a spinning cookie-shaped stop button while a reply is streaming.

Parameters

attachments

pending files shown above the field (removable).

onAddAttachment

shows an add button when non-null.

toolbar

extra controls on the left of the toolbar (e.g. a model chip).

allowQueue

while busy, a non-empty prompt can still be submitted (to be queued by the controller); an empty one shows the stop button.