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.
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
cmarklibrary.Validation Steps Performed
Responses are parsed as expected.
PR Checklist