Presentation
Introduction
Section titled “Introduction”A Present button under each assistant message turns the reply into a short deck, rewritten in simpler terms by one model call and read aloud slide by slide. It is useful for long answers that a reader would rather watch than scroll. The button renders only when you wrap the app in PresentationProvider.
Adding the Present button
Section titled “Adding the Present button”The demo web app builds the source and the deck store in its environment and wraps the app.
import { PresentationProvider } from '@pilotoo/ui/chat';import { createPresentationSource, presentationDeckStore } from '@pilotoo/chat-core';
const source = createPresentationSource(apiUrl, fetch, { credentials });
<PresentationProvider source={(request, signal) => source.present(request, signal)} // POST /presentations, slide by slide store={presentationDeckStore(storage)} // optional: keeps a finished deck 30 days> <App /></PresentationProvider>In the demo app this is presentations and presentationDecks in apps/web/src/app/environment.ts, passed to PresentationProvider in apps/web/src/app/app.tsx.
How it behaves
Section titled “How it behaves”- Slides stream: the first shows, and starts being read, as soon as the model has written it.
- Each slide has a
layout(title,bullets,statement,stat,steps,comparison; an unknown one draws asbullets) and anarrationas a list of whole sentences. - Inside a
VoiceProviderwith read aloud ready, the player reads each slide and moves on when its narration ends. Otherwise it shows the slides with manual navigation. - Redo asks for a new deck and replaces the old one.
- A finished deck is kept in memory for the session and, given a
store, in yourKeyValueStoragefor 30 days, keyed by the reply’s text and the language.
What the server does
Section titled “What the server does”POST /presentations is served by the cloud API and the local backend alike, and authenticated like every route. It takes presentationRequestSchema (text up to MAX_PRESENTATION_SOURCE_CHARS, language) and answers newline-delimited presentationLineSchema: slide lines, at most seven, then done. It uses the identity’s default model profile.
| Case | Result |
|---|---|
| The model writes no valid slide | 502 |
| A failure after the first slide | The stream ends with an error line |
| The client closes the request | The model stops |