Streaming Text
Плавный вывод потока токенов. Pro · ИИ: чат и агенты › Чат
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add streaming-text
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { StreamingText } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
text * | string | Text received so far. Append tokens as they arrive; any other change starts a new reveal. | |
streaming | boolean | false | More tokens are coming: the caret stays. |
markdown | boolean | false | Render as Markdown. Unfinished markup (**bo, half links) is closed on the fly so raw markers never flash. |
speed | number | 90 | Slowest reveal speed in characters per second; a backlog speeds it up so it never lags far behind. |
fade | boolean | true | Fade each revealed word in (plain text only). |
instant | boolean | false | Show text as soon as it arrives, without the smooth reveal. Always on with prefers-reduced-motion. |
skippable | boolean | true | Offer a Skip button while the reveal lags behind the stream. |
onComplete | () => void | Called once the reveal has caught up with a finished stream. | |
renderCitation | (index: number) => ReactNode | Turns [1] markers into nodes such as Citation chips (Markdown only). | |
labels | Partial<StreamingTextLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- AI Chat Window — Окно AI-чата
- Chat Message — Сообщения с потоковым выводом
- Message Branches — Версии сообщения и дерево веток диалога
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Prompt Composer — Поле промпта с вложениями
- Inline Suggestion — Подсказка-автодополнение в поле ввода
- Model Selector — Выбор модели ИИ
- Model Comparison — Сравнение ответов нескольких моделей
- Prompt Library — Библиотека промптов с переменными
- Chain of Thought — Ход рассуждений модели
- Tool Call — Вызов инструмента с подтверждением
Назад: Message Branches · Далее: Markdown Preview · Весь раздел «ИИ: чат и агенты»