Feature: Support folding reasoning content for thinking model #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for displaying and streaming "reasoning" content alongside chat messages in the chat plugin. The changes ensure that both message and reasoning fields are handled throughout the chat flow, from API response parsing to UI rendering. Additionally, the message folding logic is simplified and improved to better handle long messages and reasoning sections.
Reasoning support in chat messages:
reasoning
field to theChatMessage
type, allowing reasoning content to be stored and displayed with each chat message.chatStreamRequest
to parse and append both message and reasoning content from API responses, ensuring that reasoning is incrementally updated in the chat store. [1] [2]updateLastChatMessage
method to update the entireChatMessage
object (including reasoning), rather than just the message string. [1] [2]UI improvements for message folding and reasoning display:
Message
component to display reasoning content in a collapsible section, removed theexpand
prop, and improved the logic for folding/unfolding long messages and reasoning.MessageGroup
to use the newMessage
component signature without theexpand
prop.API enhancements:
postStream
method to the API utility to support streaming POST requests with optional authorization, improving flexibility for future API interactions.