diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentResponse{T}.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentResponse{T}.cs index c2fa4ff51c..c46183cf0a 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentResponse{T}.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentResponse{T}.cs @@ -12,6 +12,7 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Text.Json.Serialization.Metadata; using Microsoft.Extensions.AI; +using Microsoft.Shared.Diagnostics; namespace Microsoft.Agents.AI; @@ -28,8 +29,11 @@ public class AgentResponse : AgentResponse /// /// The from which to populate this . /// The to use when deserializing the result. + /// is . public AgentResponse(AgentResponse response, JsonSerializerOptions serializerOptions) : base(response) { + _ = Throw.IfNull(serializerOptions); + this._serializerOptions = serializerOptions; } @@ -38,8 +42,11 @@ public class AgentResponse : AgentResponse /// /// The from which to populate this . /// The to use when deserializing the result. + /// is . public AgentResponse(ChatResponse response, JsonSerializerOptions serializerOptions) : base(response) { + _ = Throw.IfNull(serializerOptions); + this._serializerOptions = serializerOptions; }