ValyroUI English version

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';

Пропсы

PropTypeDefault
role *'user' | 'assistant' | 'system'Author of the message (the element's ARIA role is set by the component).
content *stringMarkdown for assistant replies; plain text for user and system messages.
namestringDisplay name. Defaults to labels.assistant / labels.user.
avatarReactNodeReplaces the assistant's monogram tile (the first letter of its name); shown beside user messages when given.
timestampDateInputSend time (Date, ISO string or epoch ms), shown as a localized time; unparseable values are hidden.
streamingbooleanfalseReply still generating: a blinking caret, or a "Thinking" shimmer while empty.
attachmentsChatAttachment[]Files sent with a user message, or produced by an assistant reply.
footerReactNodeExtra content under an assistant reply, e.g. a compact TokenUsage.
childrenReactNodeParts of an agent turn shown above the reply text: a ChainOfThought, ToolCall cards…
renderCitation(index: number) => ReactNodeTurns [1] markers in the reply into nodes such as Citation chips (see MarkdownPreview).
actionsbooleantrueShow copy / regenerate / feedback on assistant replies. Default true.
onRegenerate() => voidAdds a Regenerate action.
feedbackChatFeedbackControlled feedback; use with onFeedbackChange.
defaultFeedbackChatFeedbacknullInitial feedback when uncontrolled.
onFeedbackChange(feedback: ChatFeedback) => voidCalled with the new feedback when it changes.
localestringBCP 47 locale for the timestamp and attachment sizes; defaults to the ThemeProvider's, then the browser's.
labelsPartial<ChatMessageLabels>Overrides for the built-in English text; keys left out keep their defaults.

Похожие компоненты

Назад: AI Chat Window · Далее: Message Branches · Весь раздел «ИИ: чат и агенты»