[BREAKING] Remove NotifyThreadOfNewMessagesAsync AIAgent helper (#2450)

* Remove NotifyThreadOfNewMessagesAsync helper from AIAgent

* Fix bug

* Update comment
This commit is contained in:
westey
2025-11-25 11:59:26 +00:00
committed by GitHub
parent 1dde57981e
commit b6c3b8d3f2
10 changed files with 31 additions and 181 deletions
@@ -4,8 +4,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.AI;
namespace Microsoft.Agents.AI;
@@ -116,10 +114,6 @@ public abstract class InMemoryAgentThread : AgentThread
public override object? GetService(Type serviceType, object? serviceKey = null) =>
base.GetService(serviceType, serviceKey) ?? this.MessageStore?.GetService(serviceType, serviceKey);
/// <inheritdoc />
protected internal override Task MessagesReceivedAsync(IEnumerable<ChatMessage> newMessages, CancellationToken cancellationToken = default)
=> this.MessageStore.AddMessagesAsync(newMessages, cancellationToken);
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => $"Count = {this.MessageStore.Count}";