Skip to content

.Net: Unable to reconstruct GeminiChatMessageContent ToolCalls for message history #12153

Open
@ionite34

Description

@ionite34
Contributor

Since the IReadOnlyList<GeminiFunctionToolCall>? ToolCalls property of GeminiChatMessageContent is get only (https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiChatMessageContent.cs#L96), and there is no public constructor accepting tool calls like there is for tool call results, it is not possible to recreate past history when loading context involving assistant messages with tool calls.

For manual tool invocation, (since automatic kernel tool execution is broken when Gemini returns non-first part results currently #11651), it also makes it impossible to recreate the last turn message for responding to the tool use manually when receiving streaming responses (since we need to be able to convert the streaming response to a ChatMessageContent to add it to ChatHistory)

Likely solution is adding a public constructor to GeminiChatMessageContent accepting a IEnumerable<GeminiFunctionToolCall>

Activity

added theissue type on May 19, 2025
changed the title [-]Unable to reconstruct GeminiChatMessageContent ToolCalls for message history[/-] [+].Net: Unable to reconstruct GeminiChatMessageContent ToolCalls for message history[/+] on May 19, 2025
moved this from Bug to Sprint: Planned in Semantic Kernelon Jun 3, 2025
moved this from Sprint: Planned to Sprint: In Progress in Semantic Kernelon Jun 4, 2025
moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernelon Jun 4, 2025
moved this from Sprint: In Review to Community PRs in Semantic Kernelon Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codePR: in progressUnder development and/or addressing feedbackbugSomething isn't working

Type

Projects

Status

Community PRs

Milestone

No milestone

Relationships

None yet

    Participants

    @ionite34@rogerbarreto@markwallace-microsoft

    Issue actions

      .Net: Unable to reconstruct GeminiChatMessageContent ToolCalls for message history · Issue #12153 · microsoft/semantic-kernel