Inside @aiui.reply (or @aiui.on_chat_start), PraisonAIUI gives you simple async functions to communicate with the user.
@aiui.reply
@aiui.on_chat_start
Use aiui.say() when you already have the full reply, or aiui.stream_token() to display tokens live as your AI model generates them.
aiui.say()
aiui.stream_token()
Markdown — headings, tables, links, math, and syntax-highlighted code blocks — renders automatically as tokens arrive.
Pause the agent to ask the user for clarification or confirmation using aiui.prompt(). It waits for the user's answer and returns a result object (answer.text or answer.choice).
aiui.prompt()
answer.text
answer.choice
Show buttons below a message with aiui.action_buttons() and handle clicks with @aiui.button("<name>"):
aiui.action_buttons()
@aiui.button("<name>")
Render any of PraisonAIUI's 81 UI blocks — metrics, searchable tables, pandas/Polars DataFrames, Plotly figures, charts, spreadsheets, whiteboards, cards, or aiui.layout([...]) — directly inside a chat reply with await aiui.send_block(...):
aiui.layout([...])
await aiui.send_block(...)
| Helper | Purpose | Example |
|--------|---------|---------|
| await aiui.send_block(block) | Render any UI block, DataFrame, or Plotly figure inline | await aiui.send_block(aiui.table(df, searchable=True)) |
await aiui.send_block(block)
await aiui.send_block(aiui.table(df, searchable=True))
| await aiui.image(url, alt="") | Display an inline image | await aiui.image("/static/chart.png", "Sales chart") |
await aiui.image(url, alt="")
await aiui.image("/static/chart.png", "Sales chart")
| await aiui.audio(url) | Embed an audio player | await aiui.audio("/static/briefing.mp3") |
await aiui.audio(url)
await aiui.audio("/static/briefing.mp3")
| await aiui.video(url) | Embed a video player | await aiui.video("/static/demo.mp4") |
await aiui.video(url)
await aiui.video("/static/demo.mp4")
| await aiui.file(url, name="") | Attach a downloadable file | await aiui.file("/static/report.pdf", "report.pdf") |
await aiui.file(url, name="")
await aiui.file("/static/report.pdf", "report.pdf")
| await aiui.notify(msg, type="info") | Show a toast (pass persist=True to also save in the header bell) | await aiui.notify("Saved!", type="success", persist=True) |
await aiui.notify(msg, type="info")
persist=True
await aiui.notify("Saved!", type="success", persist=True)
| await aiui.error(msg, details=...) | Show a formatted error card | await aiui.error("Request failed", details=str(exc)) |
await aiui.error(msg, details=...)
await aiui.error("Request failed", details=str(exc))
<Tip>
Want rich cards, tables, or side-by-side previews inside chat? See Message elements and A2UI canvas.
</Tip>
<CardGroup cols={2}>
<Card title="Starters & profiles" icon="sparkles" href="starters-and-profiles.md">
Give new visitors one-click prompts and switchable assistant modes.
</Card>
<Card title="Steps & reasoning" icon="git-branch" href="../features/steps.md">
Wrap tool calls and searches in collapsible, timed steps.
</CardGroup>