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(webview): add support for <think> tags in Chat Message #6845

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jan 28, 2025

RE: https://linear.app/sourcegraph/issue/CODY-4785

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

Ask Cody "how many files are there in the codebase? Enclose your thoughts inside tags before answering"

  • 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

Example:

image image

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.
@abeatrix abeatrix requested a review from arafatkatze January 28, 2025 14:50
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