diff --git a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs index fe73ee1257..4f297f6eca 100644 --- a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs @@ -145,8 +145,6 @@ public sealed class ChatClientAgent : AIAgent foreach (ChatMessage chatResponseMessage in chatResponse.Messages) { chatResponseMessage.AuthorName ??= agentName; - chatResponseMessage.MessageId ??= Guid.NewGuid().ToString("N"); - chatResponseMessage.CreatedAt ??= DateTimeOffset.UtcNow; } // Only notify the thread of new messages if the chatResponse was successful to avoid inconsistent message state in the thread. @@ -233,15 +231,12 @@ public sealed class ChatClientAgent : AIAgent throw; } - string? messageId = null; while (hasUpdates) { var update = responseUpdatesEnumerator.Current; if (update is not null) { update.AuthorName ??= this.Name; - update.CreatedAt ??= DateTimeOffset.UtcNow; - update.MessageId ??= (messageId ??= Guid.NewGuid().ToString("N")); responseUpdates.Add(update); yield return new(update) { AgentId = this.Id };