-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add think block support for AI assistant messages #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Created ThinkBlockHeader component with expand/collapse functionality - Created ThinkBlockContent component for rendering think content - Enhanced StreamdownMarkdown to detect and extract <think> and <details> tags - Added automatic expansion when streaming starts - Integrated think block support in Answer component 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Added translations for think block status messages: - thinking: Thinking.../思考中... - stopped: Stopped/已停止 - completed: Thought for/思考完成 Supported languages: en, zh, ja, fr, es, vi 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
@Eric-Guo cc : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds collapsible think block support for AI assistant messages to enhance user experience by providing visibility into AI reasoning processes. The implementation supports both <think> and <details> tags for compatibility and integrates seamlessly with the existing streaming markdown component.
- Added ThinkBlockHeader and ThinkBlockContent components for rendering collapsible think blocks
- Extended StreamdownMarkdown component to extract and handle think block content
- Added internationalization support for think block status text across 6 languages
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| i18n/lang/common.*.ts | Added translations for thinking states (thinking, stopped, completed) |
| app/components/chat/think-block/think-block-header.tsx | Header component with status display and toggle functionality |
| app/components/chat/think-block/think-block-content.tsx | Content component for rendering think block markdown |
| app/components/chat/think-block/index.tsx | Barrel export for think block components |
| app/components/chat/answer/index.tsx | Updated to pass streaming status to StreamdownMarkdown |
| app/components/base/streamdown-markdown.tsx | Enhanced to detect and render think blocks with streaming support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
UI is good, I only suggest like 7d177ce, using upstream changed Streamdown component, so every chat can using only one Streamdown component to save some memory, also such Streamdown will running much effective. |
Summary
<think>and<details>tags for compatibilityImplementation Details
Components Created
Core Features
<think>and<details>tags at the beginning of messagesTechnical Approach
The implementation extends the existing
StreamdownMarkdowncomponent to:Test Plan
<think>tags<details>tags🤖 Generated with Claude Code