ValyroUI English version

Prompt Library

Библиотека промптов с переменными. Pro · ИИ: чат и агенты › Промпт и модели

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add prompt-library
npm install valyro-ui-pro

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

Пропсы

PropTypeDefault
prompts *SavedPrompt[]Saved prompts to browse, search and insert; {{variables}} in a template become fields to fill in.
categoriesstring[]Category filter order. Defaults to the categories of prompts, in order of appearance.
favoritesstring[]Ids of starred prompts.
defaultFavoritesstring[][]Initial favorites when uncontrolled.
onFavoritesChange(ids: string[]) => voidCalled with the new favorites when it changes.
selectedstring | nullId of the open prompt.
defaultSelectedstring | nullnullInitial selected when uncontrolled.
onSelectedChange(id: string | null) => voidCalled with the new selected when it changes.
onInsert *(text: string, prompt: SavedPrompt) => voidCalled with the filled-in prompt text.
labelsPartial<PromptLibraryLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

Назад: Model Comparison · Далее: Chain of Thought · Весь раздел «ИИ: чат и агенты»