Add go_to_page
Pass destinations and navigate to AssistedProvider. With both, the provider lends go_to_page and show_links. Without either, it lends neither.
Name the pages
Section titled “Name the pages”destinations maps a page’s name to its path. A path with :id takes an id. From examples/app/app/assistant.tsx:
const destinations = { home: "/", orders: "/orders", order: "/orders/:id", customers: "/customers", settings: "/settings",};Define it at module scope, as the example does.
Pass the router
Section titled “Pass the router”navigate opens a path. In Next.js it is router.push. From examples/app/app/assistant.tsx:
<AssistedProvider runtime={runtime} destinations={destinations} navigate={(path) => router.push(path)} >What the assistant gets
Section titled “What the assistant gets”go_to_page({ to, id? })callsnavigate, waits up to 5 seconds for the assisted page to change, and answersOpened <path>.with the note of the page now open.show_links({ items })shows a card of links, each a destination with a title and a one-line gist. A click callsnavigate.
The universal instructions tell the assistant to use go_to_page when the user asks to go somewhere or the work is on another page. The answers and errors are in the model context reference.