Tool Call
Вызов инструмента с подтверждением. Pro · ИИ: чат и агенты › Агенты и рассуждения
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add tool-call
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ToolCall } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
name * | string | Tool identifier as the model calls it, e.g. search_docs. | |
title | ReactNode | Human-readable title. Defaults to name. | |
icon | ReactNode | Replaces the wrench icon. | |
status * | 'awaiting-approval' | 'running' | 'success' | 'error' | 'denied' | Lifecycle stage: sets the status icon and label, the live timer, the error and the approval step. | |
args | unknown | Arguments the model passed (JSON-serialisable); shown as formatted JSON. | |
result | unknown | Tool output: strings show as text, anything else as formatted JSON. | |
renderResult | (result: unknown) => ReactNode | Custom result view, e.g. a weather card or a table. | |
error | ReactNode | What went wrong, shown while status is error. | |
onRetry | () => void | Adds Retry to the error. | |
startedAt | DateInput | Start time; a running call counts up from it. | |
duration | number | Run time in milliseconds, shown once the call has finished. | |
onApprove | (approval: ToolCallApproval) => void | Human-in-the-loop: shown with Deny while status is awaiting-approval. | |
onDeny | () => void | Adds a Deny button to the approval step while status is awaiting-approval. | |
approvalPrompt | ReactNode | Replaces the default approval prompt. | |
variant | 'card' | 'inline' | 'card' | inline is a compact row for chat transcripts. Default card. |
open | boolean | Arguments and result are shown. Default: open while awaiting approval. | |
defaultOpen | boolean | Initial open when uncontrolled. | |
onOpenChange | (open: boolean) => void | Called with the new open when it changes. | |
locale | string | BCP 47 locale for timings; defaults to the ThemeProvider's. | |
labels | Partial<ToolCallLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Chain of Thought — Ход рассуждений модели
- Agent Plan — Живой план задач агента
- Agent Trace Timeline — Шаги агента на водопаде: время, токены, стоимость, вход и выход без секретов
- Agent Approval Gate — Подтверждение действия агента: риск, diff, явное согласие и журнал решений
- Memory Panel — Что помнит ассистент
- AI Chat Window — Окно AI-чата
- Chat Message — Сообщения с потоковым выводом
- Message Branches — Версии сообщения и дерево веток диалога
- Streaming Text — Плавный вывод потока токенов
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Prompt Composer — Поле промпта с вложениями
Назад: Chain of Thought · Далее: Agent Plan · Весь раздел «ИИ: чат и агенты»