.Net: Add public ctor for GeminiChatMessageContent with ToolCalls
Motivation and Context
Fixes #12153
Since the IReadOnlyList<GeminiFunctionToolCall>? ToolCalls property of GeminiChatMessageContent is get only, and there is no public constructor accepting tool calls like there is for tool call results, it is currently not possible to recreate past history when loading context involving assistant messages with tool calls.
For manual tool invocation, it makes it impossible to recreate the last turn message for responding to the tool use manually.
This PR adds a public constructor to GeminiChatMessageContent accepting a IEnumerable<GeminiFunctionToolCall>
Description
Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [x] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone :smile:
@microsoft-github-policy-service agree
@ionite34 Thanks for the contribution.
GeminiChatMessageContent type is intended to be used only internally, any attempt on reconstructing it should be done using the existing abstractions for FunctionCallContent and FunctionResultContent.
Ideally also for Serialization and Deserialization into the respective specialized type we recommend using the JsonConverter approach, something similar how was done in this PR for OpenAIChatMessageContent.
- #12352