Inline Suggestion
Подсказка-автодополнение в поле ввода. Pro · ИИ: чат и агенты › Промпт и модели
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add inline-suggestion
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { InlineSuggestion } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | string | Controlled value; use with onValueChange. | |
defaultValue | string | '' | Initial value when uncontrolled. |
onValueChange | (value: string) => void | Called with the new value when it changes. | |
getSuggestion * | (text: string, request: InlineSuggestionRequest) => Promise<string | null | undefined> | string | null | undefined | Returns the completion for text (what follows the caret), or nothing. Called after the user pauses typing with the caret at the end; may be async. Errors go to onError. | |
debounce | number | 350 | Pause in typing before asking, in ms. |
minLength | number | 3 | Minimum text length before asking. |
multiline | boolean | true | A textarea (default) or a single-line input. |
showHint | boolean | true | Show the Tab key hint next to a suggestion. |
defaultSuggestion | string | A suggestion shown from the first render, before focus: a static preview, or a completion the app already has for defaultValue. It stays until the field loses focus, is edited or dismissed; Tab and Ctrl/⌘ → accept it like a fetched one. | |
onAccept | (accepted: string, kind: 'all' | 'word') => void | Called with the accepted text: all of it (Tab) or one word (Ctrl/⌘ →). | |
onError | (error: unknown) => void | A failed getSuggestion. Without it the error is logged to the console. | |
ref | Ref<HTMLTextAreaElement | HTMLInputElement> | The text field: the <textarea>, or the <input> when multiline is off. | |
labels | Partial<InlineSuggestionLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Prompt Composer — Поле промпта с вложениями
- Model Selector — Выбор модели ИИ
- Model Comparison — Сравнение ответов нескольких моделей
- Prompt Library — Библиотека промптов с переменными
- AI Chat Window — Окно AI-чата
- Chat Message — Сообщения с потоковым выводом
- Message Branches — Версии сообщения и дерево веток диалога
- Streaming Text — Плавный вывод потока токенов
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Chain of Thought — Ход рассуждений модели
- Tool Call — Вызов инструмента с подтверждением
Назад: Prompt Composer · Далее: Model Selector · Весь раздел «ИИ: чат и агенты»