.NET: [BREAKING] Add GetService for AIContextProviders and ChatMessageStore (#874)

* Add GetService for AIContextProviders and ChatMessageStore

* Change styling and fix format issues

* Update sample code to allow for missing memory component.
This commit is contained in:
westey
2025-09-24 15:58:16 +01:00
committed by GitHub
Unverified
parent ae018ca4d9
commit bd61e5f411
17 changed files with 431 additions and 131 deletions
@@ -131,6 +131,22 @@ public class InMemoryAgentThreadTests
#endregion
#region GetService Tests
[Fact]
public void GetService_RequestingChatMessageStore_ReturnsChatMessageStore()
{
// Arrange
var thread = new TestInMemoryAgentThread();
// Act & Assert
Assert.NotNull(thread.GetService(typeof(ChatMessageStore)));
Assert.Same(thread.GetMessageStore(), thread.GetService(typeof(ChatMessageStore)));
Assert.Same(thread.GetMessageStore(), thread.GetService(typeof(InMemoryChatMessageStore)));
}
#endregion
// Sealed test subclass to expose protected members for testing
private sealed class TestInMemoryAgentThread : InMemoryAgentThread
{