-
Notifications
You must be signed in to change notification settings - Fork 1.6k
.NET: [Bug]: Update OpenAI 2.9.1 to prevent MissingMethodException #4380
Copy link
Copy link
Closed
Labels
.NETblocked externalThis label indicates whenever an issue or a PR cannot proceed due to an external dependencyThis label indicates whenever an issue or a PR cannot proceed due to an external dependencybugSomething isn't workingSomething isn't workingexternalThis issue is related to an external service / productThis issue is related to an external service / productrequested-infov1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Metadata
Metadata
Assignees
Labels
.NETblocked externalThis label indicates whenever an issue or a PR cannot proceed due to an external dependencyThis label indicates whenever an issue or a PR cannot proceed due to an external dependencybugSomething isn't workingSomething isn't workingexternalThis issue is related to an external service / productThis issue is related to an external service / productrequested-infov1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Type
Projects
Status
Done
Description
The following code sample compiles without problems, but shows the following error during runtime:
Works with
GetChatClient.Code Sample
using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using OpenAI; using OpenAI.Responses; // Minimal repro for: // System.MissingMethodException: Method not found: // 'System.String OpenAI.Responses.ResponsesClient.get_Model()' // // Guess: Microsoft.Extensions.AI.OpenAI 10.3.0 was compiled against a future version // of the OpenAI SDK that exposes ResponsesClient.Model, but OpenAI 2.9.0 (the // latest public release) does not have that property. // // Calling AsAIAgent() on the ResponsesClient triggers the bridge code inside // OpenAIResponsesChatClient..ctor which calls responseClient.Model, causing the // MissingMethodException at runtime even though the code compiles fine. var responsesClient = new OpenAIClient("dummy-key").GetResponsesClient(); try { // This throws MissingMethodException at runtime: AIAgent agent = responsesClient.AsAIAgent( instructions: "You are a helpful assistant.", name: "TestAgent"); Console.WriteLine("No exception — packages are compatible."); } catch (MissingMethodException ex) { Console.WriteLine("MissingMethodException (expected with OpenAI 2.9.0):"); Console.WriteLine(ex.Message); }Error Messages / Stack Traces
Package Versions
Microsoft.Agents.AI.OpenAI: 1.0.0-rc2, OpenAI: 2.9.0, Microsoft.Extensions.AI.OpenAI: 10.3.0
.NET Version
.NET 10
Additional Context
No response