ValyroUI Русская версия

AI Chat Window

AI chat window. Pro · AI chat and agents › Chat

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add ai-chat-window
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { AIChatWindow } from 'valyro-ui-pro';

Props

PropTypeDefault
messages *AIChatMessage[]Conversation turns in order; an empty list shows the empty state and suggestions.
onSend *(message: PromptSubmission) => voidCalled with the composer's text and files, or with a clicked suggestion.
loadingbooleanfalseA reply is generating: the composer shows Stop.
onStop() => voidCalled by the composer's Stop button while loading.
titleReactNodeHeader title. Defaults to labels.newChat.
modelsAIModel[]Shows a ModelSelector in the header.
modelstringControlled model; use with onModelChange.
defaultModelstringInitial model when uncontrolled.
onModelChange(id: string) => voidCalled with the new model when it changes.
onModelUpgrade(model: AIModel) => voidMakes plan-locked models in the header selector actionable (see ModelSelector onUpgrade).
onNewChat() => voidAdds a "New chat" button to the header.
headerActionsReactNodeExtra header controls, e.g. a "More" menu.
suggestionsstring[]Starter prompts shown while the conversation is empty; clicking one sends it.
emptyStateReactNodeReplaces the default empty-state greeting.
placeholderstringComposer placeholder. Defaults to labels.placeholder.
assistantNamestringName shown on assistant replies. Defaults to labels.assistant.
onRegenerate(messageId: string) => voidAdds Regenerate to the latest assistant reply.
onFeedback(messageId: string, feedback: ChatFeedback) => voidCalled when a thumbs up / down on an assistant reply is toggled; null when cleared.
localestringBCP 47 locale for timestamps, sizes and model metadata; defaults to the ThemeProvider's.
labelsPartial<AIChatWindowLabels>Every string in the window, its messages, composer and model menu.

Related components

Previous: Support Center · Next: Chat Message · All AI chat and agents