.NET: Remove AgentThread.GetMessagesAsync (#668)

* Remove AgentThread.GetMessagesAsync

* Remove unecessary using
This commit is contained in:
westey
2025-09-09 17:40:07 +01:00
committed by GitHub
Unverified
parent 5c3c2fe634
commit ec5ea3c8a8
7 changed files with 8 additions and 79 deletions
@@ -344,9 +344,9 @@ public sealed class ChatClientAgent : AIAgent
// Add any existing messages from the thread to the messages to be sent to the chat client.
List<ChatMessage> threadMessages = [];
await foreach (ChatMessage message in thread.GetMessagesAsync(cancellationToken).ConfigureAwait(false))
if (thread.MessageStore is not null)
{
threadMessages.Add(message);
threadMessages.AddRange(await thread.MessageStore.GetMessagesAsync(cancellationToken).ConfigureAwait(false));
}
// Add the input messages to the end of thread messages.