Display source snippets with code_block() and formatted API payloads or agent tool outputs with json_view().
code_block()
json_view()
<ComponentPreview title="Code Block & JSON View">
[
{"type": "code_block", "language": "python", "code": "import praisonaiui as aiui\n\n@aiui.reply\nasync def reply(msg):\n await aiui.say(f'Echo: {msg}')"},
{"type": "json_view", "data": {"agent": "researcher", "model": "gpt-4o", "latency_ms": 118, "tools": ["web_search", "memory"]}}
]
</ComponentPreview>
<Tabs>
<Tab title="Python">
</Tab>
<Tab title="YAML">
</Tabs>
| Component | Parameter | Description |
|---|---|---|
| code_block | code, language | Code string and syntax language identifier (python, yaml, json, bash, etc.). |
code_block
code
language
python
yaml
json
bash
| json_view | data | Any JSON-serializable dict or list formatted with indentation. |
json_view
data