Skip to content

Commit 5f10bda

Browse files
authored
Change RawRepresentation for AgentRunResponse/Update to ChatResponse/Update instead of RawRepresentation from that. (#278)
1 parent 1ed89d4 commit 5f10bda

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

dotnet/src/Microsoft.Extensions.AI.Agents.Abstractions/AgentRunResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public AgentRunResponse(ChatResponse response)
5454
this.AdditionalProperties = response.AdditionalProperties;
5555
this.CreatedAt = response.CreatedAt;
5656
this.Messages = response.Messages;
57-
this.RawRepresentation = response.RawRepresentation;
57+
this.RawRepresentation = response;
5858
this.ResponseId = response.ResponseId;
5959
this.Usage = response.Usage;
6060
}

dotnet/src/Microsoft.Extensions.AI.Agents.Abstractions/AgentRunResponseUpdate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public AgentRunResponseUpdate(ChatResponseUpdate chatResponseUpdate)
7070
this.Contents = chatResponseUpdate.Contents;
7171
this.CreatedAt = chatResponseUpdate.CreatedAt;
7272
this.MessageId = chatResponseUpdate.MessageId;
73-
this.RawRepresentation = chatResponseUpdate.RawRepresentation;
73+
this.RawRepresentation = chatResponseUpdate;
7474
this.ResponseId = chatResponseUpdate.ResponseId;
7575
this.Role = chatResponseUpdate.Role;
7676
}

dotnet/tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/AgentRunResponseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void ConstructorWithChatResponseRoundtrips()
6161
Assert.Equal(chatResponse.CreatedAt, response.CreatedAt);
6262
Assert.Same(chatResponse.Messages, response.Messages);
6363
Assert.Equal(chatResponse.ResponseId, response.ResponseId);
64-
Assert.Same(chatResponse.RawRepresentation, response.RawRepresentation);
64+
Assert.Same(chatResponse, response.RawRepresentation as ChatResponse);
6565
Assert.Same(chatResponse.Usage, response.Usage);
6666
}
6767

dotnet/tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/AgentRunResponseUpdatesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void ConstructorWithChatResponseUpdateRoundtrips()
4848
Assert.Same(chatResponseUpdate.Contents, response.Contents);
4949
Assert.Equal(chatResponseUpdate.CreatedAt, response.CreatedAt);
5050
Assert.Equal(chatResponseUpdate.MessageId, response.MessageId);
51-
Assert.Same(chatResponseUpdate.RawRepresentation, response.RawRepresentation);
51+
Assert.Same(chatResponseUpdate, response.RawRepresentation as ChatResponseUpdate);
5252
Assert.Equal(chatResponseUpdate.ResponseId, response.ResponseId);
5353
Assert.Equal(chatResponseUpdate.Role, response.Role);
5454
}

0 commit comments

Comments
 (0)