When to use it
Update statusLabel with the status, such as "Writing…" then "Done". Put message actions in actions and source citations in sources.
Show an assistant reply with one concise status announcement.
Native example
Update statusLabel with the status, such as "Writing…" then "Done". Put message actions in actions and source citations in sources.
import androidx.compose.foundation.layout.*
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import com.santi020k.lumen.*
@Composable
fun StreamedAnswerExample(answer: String, streaming: Boolean) {
var feedback by remember { mutableStateOf<LumenMessageFeedback?>(null) }
LumenStreamMessage(
statusLabel = if (streaming) "Writing…" else "Answered in 4 seconds",
status = if (streaming) LumenStreamStatus.Streaming else LumenStreamStatus.Complete,
actions = {
LumenMessageActions(
messageId = "answer-1",
copyValue = answer,
feedback = feedback,
onFeedback = { _, next -> feedback = next },
disabled = streaming
)
},
sources = { LumenSourceCitation("Lumen docs", "https://lumen.santi020k.com/docs") }
) {
Text(answer)
}
}Reference
The primary shared and platform-specific options exposed by LumenStreamMessage.
| API | Values or type | Default | Description |
|---|---|---|---|
| status / statusLabel / label | stream status / announced text / accessible name | idle / required / Assistant | Update statusLabel with the status, such as "Writing…" then "Done". |
Native behavior
Update statusLabel with the status, such as "Writing…" then "Done". Put message actions in actions and source citations in sources.
Announces the status label once per change; streamed text never announces.
Shared component