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

[WIP] Showing the Think process for Deep Seek R1 in Cody UI #6896

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

Conversation

arafatkatze
Copy link
Contributor

@arafatkatze arafatkatze commented Jan 31, 2025

Originally a PR from @abeatrix on having a thinktag UX.

Loom Video

This PR adds a simple hack to support rendering tags in the ChatMessageContent component. The content is displayed in a collapsible details element, allowing users to view the AI's internal thought process.
The MarkdownFromCody component is also updated to allow the element.

Test plan

  • Run SG instance locally and switch to branch fake-think-tag
  • Run cody with this branch in the debugger and choose sonnet model with the local SG instance
  • Ask Cody "Tell me a long story"
  • Verify that tags are properly extracted and displayed in the ChatMessageContent component
  • Ensure that the collapsible details element functions as expected, allowing users to view the think content
  • Confirm that the MarkdownFromCody component correctly renders the element

abeatrix and others added 4 commits January 28, 2025 22:48
This PR adds support for rendering <think> tags in the ChatMessageContent component. The <think> content is displayed in a collapsible details element, allowing users to view the AI's internal thought process.

The MarkdownFromCody component is also updated to allow the <think> element.
@arafatkatze arafatkatze requested a review from abeatrix January 31, 2025 08:55
open
className={clsx(
"tw-container tw-mb-4",
"tw-border tw-border-gray-600/15 dark:tw-border-gray-500/20",
Copy link
Contributor Author

@arafatkatze arafatkatze Jan 31, 2025

Choose a reason for hiding this comment

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

Will fix all the CSS in proper files separately AFTER the design has been approved.

@PriNova
Copy link
Collaborator

PriNova commented Jan 31, 2025

@arafatkatze If you need some inspirations how I implemented it, have a look at https://github.com/PriNova/cody/blob/dev/vscode/webviews/chat/ChatMessageContent/ChatMessageContent.tsx
But to be honest, it is not somehow optimized.

I used special thinking tags to separate them from the model response for future changes.
The thinking tags I handled in the model response stream handler.
I don't know if this is the right choice, but it somehow works.

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.

3 participants