Skip to content

MissingMethodException for CodeInterpreterToolResultContent..ctor() when used with Microsoft.Extensions.AI.Abstractions 10.4.0 #238

@jdewera

Description

@jdewera

Environment details

  • Programming language: C#
  • OS: N/A
  • Language runtime version: .NET 10.0
  • Package version: Google.GenAI 1.3.0, Microsoft.Extensions.AI.Abstractions 10.4.0

Steps to reproduce

  1. Install Google.GenAI 1.3.0 alongside Microsoft.Extensions.AI 10.4.0 (which brings in Microsoft.Extensions.AI.Abstractions 10.4.0)
  2. Make a chat completion request using IChatClient.GetResponseAsync

This throws the following at runtime:

System.MissingMethodException: Method not found: 'Void Microsoft.Extensions.AI.CodeInterpreterToolResultContent..ctor()'.
   at Microsoft.Extensions.AI.GoogleGenAIChatClient.AddAIContentsForParts(List`1 parts, IList`1 contents)
   at Microsoft.Extensions.AI.GoogleGenAIChatClient.PopulateResponseContents(...)
   at Microsoft.Extensions.AI.GoogleGenAIChatClient.GetResponseAsync(...)

Google.GenAI 1.3.0 was compiled against Microsoft.Extensions.AI.Abstractions 10.3.0, where CodeInterpreterToolResultContent extended AIContent and had a parameterless constructor. In 10.4.0, it was changed to extend ToolResultContent with a required string callId parameter, which is a binary breaking change.

GoogleGenAIChatClient.cs line 610 calls new CodeInterpreterToolResultContent(), which no longer exists at runtime when 10.4.0 is resolved.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions