Skip to content
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

feat(ui): Added UI component for reasoning models #4075

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JovenSoh
Copy link
Contributor

@JovenSoh JovenSoh commented Mar 25, 2025

Related issue #3977

Adds a collapsible section that contains the reasoning steps of models such as deepseek-r1.
https://jam.dev/c/56380060-dbfa-4746-9cbd-f41ee3a4375c

Has light and dark variation.
Currently unable to collapse component during reasoning.

Before:
image

@JovenSoh JovenSoh changed the title feat(ui) Added UI component for reasoning models feat(ui): Added UI component for reasoning models Mar 25, 2025
Comment on lines 175 to 181
findMatches(
MARKDOWN_THINK_REGEX,
ThinkPlaceholder,
(match: RegExpExecArray) => ({
content: decodeURIComponent(match[1])
})
)
Copy link
Member

@wsxiaoys wsxiaoys Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of converting from PLACEHOLDER_THINK_REGEX format to MARKDOWN_THINK_REGEX format, can we just use PLACEHOLDER_THINK_REGEX here to render the think content?

@@ -396,6 +406,29 @@ export function ErrorMessageBlock({
)
}

function ThinkPlaceholder({ content }: { content: string }): JSX.Element {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function ThinkPlaceholder({ content }: { content: string }): JSX.Element {
function ThinkBlock({ content }: { content: string }): JSX.Element {

nit

Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also attached a screen recording (we generally use jam.dev) to demonstrate the feature? thanks!

@wsxiaoys wsxiaoys marked this pull request as ready for review March 25, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants