Chat Message
Сообщения с потоковым выводом. Pro · ИИ: чат и агенты › Чат
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add chat-message
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ChatMessage } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
role * | 'user' | 'assistant' | 'system' | Author of the message (the element's ARIA role is set by the component). | |
content * | string | Markdown for assistant replies; plain text for user and system messages. | |
name | string | Display name. Defaults to labels.assistant / labels.user. | |
avatar | ReactNode | Replaces the assistant's monogram tile (the first letter of its name); shown beside user messages when given. | |
timestamp | DateInput | Send time (Date, ISO string or epoch ms), shown as a localized time; unparseable values are hidden. | |
streaming | boolean | false | Reply still generating: a blinking caret, or a "Thinking" shimmer while empty. |
attachments | ChatAttachment[] | Files sent with a user message, or produced by an assistant reply. | |
footer | ReactNode | Extra content under an assistant reply, e.g. a compact TokenUsage. | |
children | ReactNode | Parts of an agent turn shown above the reply text: a ChainOfThought, ToolCall cards… | |
renderCitation | (index: number) => ReactNode | Turns [1] markers in the reply into nodes such as Citation chips (see MarkdownPreview). | |
actions | boolean | true | Show copy / regenerate / feedback on assistant replies. Default true. |
onRegenerate | () => void | Adds a Regenerate action. | |
feedback | ChatFeedback | Controlled feedback; use with onFeedbackChange. | |
defaultFeedback | ChatFeedback | null | Initial feedback when uncontrolled. |
onFeedbackChange | (feedback: ChatFeedback) => void | Called with the new feedback when it changes. | |
locale | string | BCP 47 locale for the timestamp and attachment sizes; defaults to the ThemeProvider's, then the browser's. | |
labels | Partial<ChatMessageLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- AI Chat Window — Окно AI-чата
- Message Branches — Версии сообщения и дерево веток диалога
- Streaming Text — Плавный вывод потока токенов
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Prompt Composer — Поле промпта с вложениями
- Inline Suggestion — Подсказка-автодополнение в поле ввода
- Model Selector — Выбор модели ИИ
- Model Comparison — Сравнение ответов нескольких моделей
- Prompt Library — Библиотека промптов с переменными
- Chain of Thought — Ход рассуждений модели
- Tool Call — Вызов инструмента с подтверждением
Назад: AI Chat Window · Далее: Message Branches · Весь раздел «ИИ: чат и агенты»