ValyroUI English version

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';

Пропсы

PropTypeDefault
name *stringTool identifier as the model calls it, e.g. search_docs.
titleReactNodeHuman-readable title. Defaults to name.
iconReactNodeReplaces 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.
argsunknownArguments the model passed (JSON-serialisable); shown as formatted JSON.
resultunknownTool output: strings show as text, anything else as formatted JSON.
renderResult(result: unknown) => ReactNodeCustom result view, e.g. a weather card or a table.
errorReactNodeWhat went wrong, shown while status is error.
onRetry() => voidAdds Retry to the error.
startedAtDateInputStart time; a running call counts up from it.
durationnumberRun time in milliseconds, shown once the call has finished.
onApprove(approval: ToolCallApproval) => voidHuman-in-the-loop: shown with Deny while status is awaiting-approval.
onDeny() => voidAdds a Deny button to the approval step while status is awaiting-approval.
approvalPromptReactNodeReplaces the default approval prompt.
variant'card' | 'inline''card'inline is a compact row for chat transcripts. Default card.
openbooleanArguments and result are shown. Default: open while awaiting approval.
defaultOpenbooleanInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
localestringBCP 47 locale for timings; defaults to the ThemeProvider's.
labelsPartial<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 · Весь раздел «ИИ: чат и агенты»