Chain of Thought
Model reasoning steps. Pro · AI chat and agents › Agents and reasoning
Collapsible reasoning trace: the steps a model took before answering.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add chain-of-thought
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ChainOfThought } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
steps * | ThoughtStep[] | Reasoning steps in order; while streaming, the active one is previewed in the collapsed header. | |
streaming | boolean | false | The model is still reasoning: the header shimmers and the panel opens. |
duration | number | Reasoning time in milliseconds, for the "Thought for 12s" summary. | |
open | boolean | Controlled open; use with onOpenChange. | |
defaultOpen | boolean | Default: open while streaming. | |
onOpenChange | (open: boolean) => void | Called with the new open when it changes. | |
autoCollapse | boolean | true | Collapse when streaming turns off, so the answer takes the focus. Default true. |
locale | string | BCP 47 locale for the duration; defaults to the ThemeProvider's. | |
labels | Partial<ChainOfThoughtLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Tool Call — Tool call with approval
- Agent Plan — Live agent task plan
- Agent Trace Timeline — Agent steps as a waterfall: time, tokens, cost, inputs and outputs with secrets redacted
- Agent Approval Gate — Agent action approval: risk, diff, explicit consent and a decision log
- Memory Panel — What the assistant remembers
- AI Chat Window — AI chat window
- Chat Message — Messages with streaming output
- Message Branches — Message versions and a conversation branch tree
- Streaming Text — Smooth token streaming
- Markdown Preview — Rendered Markdown
- Response Feedback — Answer rating and a rubric for reviewers
- Prompt Composer — Prompt field with attachments
Previous: Prompt Library · Next: Tool Call · All AI chat and agents