AI Chat Window
Окно AI-чата. Pro · ИИ: чат и агенты › Чат
Установка
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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
messages * | AIChatMessage[] | Conversation turns in order; an empty list shows the empty state and suggestions. | |
onSend * | (message: PromptSubmission) => void | Called with the composer's text and files, or with a clicked suggestion. | |
loading | boolean | false | A reply is generating: the composer shows Stop. |
onStop | () => void | Called by the composer's Stop button while loading. | |
title | ReactNode | Header title. Defaults to labels.newChat. | |
models | AIModel[] | Shows a ModelSelector in the header. | |
model | string | Controlled model; use with onModelChange. | |
defaultModel | string | Initial model when uncontrolled. | |
onModelChange | (id: string) => void | Called with the new model when it changes. | |
onModelUpgrade | (model: AIModel) => void | Makes plan-locked models in the header selector actionable (see ModelSelector onUpgrade). | |
onNewChat | () => void | Adds a "New chat" button to the header. | |
headerActions | ReactNode | Extra header controls, e.g. a "More" menu. | |
suggestions | string[] | Starter prompts shown while the conversation is empty; clicking one sends it. | |
emptyState | ReactNode | Replaces the default empty-state greeting. | |
placeholder | string | Composer placeholder. Defaults to labels.placeholder. | |
assistantName | string | Name shown on assistant replies. Defaults to labels.assistant. | |
onRegenerate | (messageId: string) => void | Adds Regenerate to the latest assistant reply. | |
onFeedback | (messageId: string, feedback: ChatFeedback) => void | Called when a thumbs up / down on an assistant reply is toggled; null when cleared. | |
locale | string | BCP 47 locale for timestamps, sizes and model metadata; defaults to the ThemeProvider's. | |
labels | Partial<AIChatWindowLabels> | Every string in the window, its messages, composer and model menu. |
Похожие компоненты
- Chat Message — Сообщения с потоковым выводом
- Message Branches — Версии сообщения и дерево веток диалога
- Streaming Text — Плавный вывод потока токенов
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Prompt Composer — Поле промпта с вложениями
- Inline Suggestion — Подсказка-автодополнение в поле ввода
- Model Selector — Выбор модели ИИ
- Model Comparison — Сравнение ответов нескольких моделей
- Prompt Library — Библиотека промптов с переменными
- Chain of Thought — Ход рассуждений модели
- Tool Call — Вызов инструмента с подтверждением
Назад: Support Center · Далее: Chat Message · Весь раздел «ИИ: чат и агенты»