Displays¶
Some tools show something as well as answering: a table of rows, a chart, a single number, a file to download, or a definition to save. Each one is a display. It comes with the tool's result, so you can draw it however suits your app. The agent never reads a display's rows: it works from the tool's short text, and the full table stays with Klaris.
You get displays in two places:
- Streaming: a
response.display.addedevent as soon as the tool has made it (before the answer is written). - The response and the conversation's items: a
function_call_outputitem carriesdisplayswhen its tool showed anything.
Shape¶
{
"id": "dsp_7f3c…",
"kind": "chart",
"title": "Renewals by month",
"subtitle": "Jan–Nov 2026",
"data": {
"columns": [
{
"key": "month",
"label": "Month",
"type": "date"
},
{
"key": "renewals",
"label": "Renewals",
"type": "integer"
}
],
"rows": [
[
"2026-01-01",
41
],
[
"2026-02-01",
37
]
],
"row_count": 11,
"truncated": false,
"table_id": "tbl_…"
},
"encoding": {
"type": "bar",
"x": "month",
"y": [
"renewals"
]
},
"provenance": {
"source": "own_query",
"connector": "Warehouse",
"sql": "select …",
"definition_ids": []
}
}
| Field | What it is |
|---|---|
kind |
table, chart, metric (one number), file or definition_proposal. |
data |
The columns and the rows: a preview of up to 50 for a table or number, up to 2,000 points for a chart. row_count is the full count; truncated is true when there are more rows than are sent. table_id names the saved table it came from. |
columns[].type |
string, number, integer, date, datetime, boolean, percent or currency. Dates are ISO text. A currency column carries unit, the workspace's currency symbol ($ unless the workspace set another). A percent value is already a percentage (12.5 means 12.5%). |
columns[].label |
The column's name in plain words ("Total annual premium"); key is the column's name in the data. |
encoding |
For a chart or metric: how to draw it. type is bar, line, area, pie, donut, scatter, combo, heatmap, funnel or metric (a pie or donut shows at most 8 slices: the 7 largest, and Other adding up the rest); orientation is horizontal for bars along the side; x, y, y2, series, value and compare name columns. |
provenance |
Where it came from: source (own_query, transform, dashboard, file, chat or tool), and when known the connection, the SQL, the measure and the definitions used. |
file |
For a file the agent made (Excel or CSV): file_id, filename, format (xlsx or csv), version, sheets (each name and rows) and size_bytes. Download it with GET /files/{file_id}/content?user=… (the same person). A change to a file makes a new version; earlier versions stay downloadable. |
proposal |
For a definition proposal: its item_id, the name and definition the person gave, optional sql, and check (whether it repeats or differs from a definition the workspace already has, with a plain note). The person saves it from Klaris; it is never saved on its own. |
More rows than the preview¶
A table display carries its first 50 rows. For the rest, ask for pages of its saved table:
GET /tables/{table_id}/rows?user=…&offset=50&limit=50 (up to 500 rows a page), with the table_id from data. It
answers 410 table_cleared once the full result has been cleared (after 90 days without use): the display itself
still shows what it showed, and asking the agent again gives a fresh result.
New kinds and fields may be added later, so ignore any you don't know.