Add some DebuggerDisplays / DebuggerTypeProxys to abstraction types (#1144)

This commit is contained in:
Stephen Toub
2025-10-03 08:51:49 +00:00
committed by GitHub
parent c543dbaa92
commit 4daeeb0f07
7 changed files with 32 additions and 0 deletions
@@ -3,6 +3,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.Json;
using System.Threading;
@@ -26,6 +27,8 @@ namespace Microsoft.Agents.AI;
/// message reduction strategies or alternative storage implementations.
/// </para>
/// </remarks>
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(DebugView))]
public sealed class InMemoryChatMessageStore : ChatMessageStore, IList<ChatMessage>
{
private List<ChatMessage> _messages;
@@ -226,4 +229,10 @@ public sealed class InMemoryChatMessageStore : ChatMessageStore, IList<ChatMessa
/// </summary>
BeforeMessagesRetrieval
}
private sealed class DebugView(InMemoryChatMessageStore store)
{
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public ChatMessage[] Items => store._messages.ToArray();
}
}