Components/AI Answer

AI Answer

A multi-turn Q&A with streamed answers, numbered citations, and follow-ups.

Since 0.6.3BETA

This component doc is in progress

This page is still being migrated. Demos and API details may change.

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 content and keep streaming true until the source ends; stopping sets it to false.
  • Citations follow the order of sources, so [n] is sources[n - 1]; copy and share the full text you hold, not the screen, which trails by up to maxLagMs.
  • 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.
RegionComponentsRole
HeaderTxIconButtonThe answer state and Start over
ConversationTxConversationStream, TxChatMessageMulti-turn conversation and question bubbles
AnswerTxStreamElementWord-by-word reveal and citation chips
After an answerTxMessageActions, TxSources, TxSuggestionChipsActions, sources, and follow-ups when done
InputTxPromptBar, TxButtonQuestions and Stop generating