Skip to content

Commit f74c0c9

Browse files
Copilotstephentoub
andcommitted
Improve SamplingMessage DebuggerDisplay to show text content
Show actual text when Content contains a single TextContentBlock, similar to PromptMessage Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 2cf72e1 commit f74c0c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ModelContextProtocol.Core/Protocol/SamplingMessage.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ private string DebuggerDisplay
5757
{
5858
get
5959
{
60+
// Show actual text content if it's a single TextContentBlock
61+
if (Content.Count == 1 && Content[0] is TextContentBlock textBlock)
62+
{
63+
return $"Role = {Role}, Text = \"{textBlock.Text}\"";
64+
}
65+
6066
string contentTypes = Content.Count == 1
6167
? Content[0].Type
6268
: $"{Content.Count} items";

0 commit comments

Comments
 (0)