Chatbots made easy
Turn a chatlas client into a full chatbot UI — in 5 lines.
app.py
client= gives you for freeYou could wire all this up manually… but why would you?
Not using chatlas? Wire up any async generator:
By default, tool results show as collapsible text. But you can make them beautiful.
SCREENSHOT: side-by-side comparison —
(left) default tool result display (plain collapsible text)
(right) custom ToolResultDisplay with icon, title, and formatted markdown
from chatlas import ContentToolResult
from shinychat.types import ToolResultDisplay
import faicons
def get_weather(lat: float, lng: float, location: str) -> ContentToolResult:
"""Get the current weather for a location.
...
"""
data = call_weather_api(lat, lng)
return ContentToolResult(
value=data, # what the LLM sees
extra={
"display": ToolResultDisplay(
title=f"Weather: {location}",
icon=faicons.icon_svg("cloud-sun"),
markdown=f"**{data['temp']}°C** — {data['condition']}",
)
},
)SCREENSHOT: a shinychat conversation showing a custom tool display —
the weather card with icon, title, and formatted content
embedded naturally in the chat flow
chatlas emits OTel spans for every LLM call — latency, tokens, errors.
See what your users are actually asking, how long it takes, and what fails.
~15 minutes — pick your adventure:
Start from the exercise file:
ToolResultDisplayTake your working chatbot and:
Exercise file: exercises/02-shinychat-starter.py