-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Improve parsing of responses from the AI #18201
Conversation
I initially wanted to directly use the |
if (!currentRun.empty()) | ||
{ | ||
const auto chatMsg = winrt::make<ChatMessage>(winrt::to_hstring(currentRun), false, false); | ||
messageParts.push_back(chatMsg); | ||
currentRun.clear(); | ||
} |
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.
Don't like that this is the exact same as lines 227-231 but making a helper function for 3 lines of code seems silly...
does it? could we just put all the output in a single speech bubble? i'd rather avoid reimplementing the cmark->xaml parser that mike just wrote if at all possible. |
mine had a play button, chat needs a copy. that might make the reuse a little trickier |
I considered this but there are enough times where the AI sends a large response with multiple code blocks in it that it felt like the palette needs to do its own parsing. For example: If we didn't do our own parsing, there'd be one big bubble with 2 code blocks in it and we wouldn't know which one to use when the user clicks the bubble to send the output to the shell |
Why not both? Having a copy button in your markdown pane seems useful as well. It would also mirror GitHub which also has a copy button on each code block. |
Closing this in favour of #18220 |
Summary of the Pull Request
Instead of manually parsing out code blocks from the response we receive, use the
cmark
library.Validation Steps Performed
Responses are parsed as expected.
PR Checklist