Skip to content

Commit 04dcf86

Browse files
.Net: Update GeminiChatMessageContent to support System.Text.Json deserialization when calledToolResult is null (#11622)
### Motivation and Context Changes from https://github.com/microsoft/semantic-kernel/pull/11236/files ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent 8aff8cb commit 04dcf86

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiChatMessageContent.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Text;
6+
using System.Text.Json.Serialization;
67
using Microsoft.SemanticKernel.ChatCompletion;
78
using Microsoft.SemanticKernel.Connectors.Google.Core;
89

@@ -13,6 +14,14 @@ namespace Microsoft.SemanticKernel.Connectors.Google;
1314
/// </summary>
1415
public sealed class GeminiChatMessageContent : ChatMessageContent
1516
{
17+
/// <summary>
18+
/// Creates a new instance of the <see cref="GeminiChatMessageContent"/> class
19+
/// </summary>
20+
[JsonConstructor]
21+
public GeminiChatMessageContent()
22+
{
23+
}
24+
1625
/// <summary>
1726
/// Initializes a new instance of the <see cref="GeminiChatMessageContent"/> class.
1827
/// </summary>

0 commit comments

Comments
 (0)