Show a table, a spec or a comparison
The show tools let the assistant answer with structure instead of prose. AssistedProvider lends all three on every page, so there is nothing to install. This page is about getting the answers you want from them.
| Tool | Shows | Card |
|---|---|---|
show_table |
Records of one kind as rows, their shared fields as columns | Table card |
show_spec |
One thing’s properties as label and value rows | Spec card |
show_comparison |
Two or three options side by side, with a recommendation | Comparison card |
A show tool changes nothing on the page. Its call answers Showed the user a table., a spec sheet. or a comparison., and the card renders the model’s arguments.
Know when the model reaches for them
Section titled “Know when the model reaches for them”The universal instructions tell the model when, in this line:
Answer with a card when it saves the user typing or reading: show_links when several pages are worth opening, like what to look at next; offer_choices when your question has two to four short answers; and when the user asks to see data laid out, show_table for records of one kind, show_spec for one thing's properties, show_comparison for two or three options side by side. End the turn with at least one sentence, after a card too.So the model shows a card when the user asks to see data laid out, and writes a sentence after it. In the example shop:
| The user asks, on | The assistant calls |
|---|---|
| Orders: “List the open orders as a table” | get_page_content, then show_table |
| Settings: “Show the settings as a sheet” | get_page_content, then show_spec |
| Orders: “Compare orders #1042 and #1043” | get_page_content, then show_comparison |
| Dashboard: “What needs my attention today?” | get_page_content, then show_table |
Give it the data
Section titled “Give it the data”The model fills a card from what it has read, so the page has to lend the values. Return them from content, with the fields a user would scan:
<AssistedPage name="Orders" instructions="Every order of the shop. Ship an order that is waiting to ship by its id." content={() => orders.map(({ id, customer, total, status }) => ({ id, customer, total, status }))}>The model calls get_page_content first and copies ids and values from its answer, as the universal instructions require.
Steer it from the page
Section titled “Steer it from the page”A page’s instructions win over the universal ones. Say which card fits the page, or that it should answer in prose:
<AssistedPage name="Orders" instructions="Every order of the shop. When the user asks about several orders, show them with show_table: customer, total and status." content={() => orders}>Change how they look
Section titled “Change how they look”The cards are the package’s. To render a call your own way, pass cards.table, cards.spec or cards.comparison to AssistedProvider. See Swap a card.
The tools’ parameters are listed on each card’s page and in Model context.