AI Answer
A multi-turn Q&A with streamed answers, numbered citations, and follow-ups.
Usage
Multi-turn Q&A
Plays once in view and asks one follow-up; a click or key hands it to you. Sample data.
Loading demo...
Overview
A multi-turn Q&A with traceable answers, each streamed by one TxStreamElement.
- It plays once in view and asks one follow-up about 1.6 seconds after the first answer; a click or key cancels the follow-up.
- The action row, sources, and follow-ups appear only once an answer is done; a follow-up adds a turn below.
- Stop generating ends the source at once; what has arrived is still revealed, and the answer can be regenerated.
- A numbered citation opens that turn's sources without leaving the page.
- The conversation follows the newest content and stops while you scroll up; the page never moves.
- In the docs column (640–959px) answers fill the column, and from 960px they are centered; narrow (< 640px) hides the status and avatars; reduced motion renders both turns complete.
Customization
- To wire a real service, append tokens to
contentand keepstreamingtrue until the source ends; stopping sets it to false. - Citations follow the order of
sources, so[n]issources[n - 1]; copy and share the full text you hold, not the screen, which trails by up tomaxLagMs. - Keep row ids globally unique: take a new session prefix on every reset and use it as TxConversationStream's
key. - Insert new rows in front of a permanent tail, so each turn mounts once and a streaming answer is never interrupted.
Related components
| Region | Components | Role |
|---|---|---|
| Header | TxIconButton | The answer state and Start over |
| Conversation | TxConversationStream, TxChatMessage | Multi-turn conversation and question bubbles |
| Answer | TxStreamElement | Word-by-word reveal and citation chips |
| After an answer | TxMessageActions, TxSources, TxSuggestionChips | Actions, sources, and follow-ups when done |
| Input | TxPromptBar, TxButton | Questions and Stop generating |