Missing method when calling GetResponsesClient() on AzureOpenAIClient
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
```csharp
sp.GetRequiredService().GetResponsesClient();
```
results in
```
Unhandled exception. System.MissingMethodException: Method not found: 'Void OpenAI.Responses.ResponsesClient..ctor(System.ClientModel.Primitives.ClientPipeline, OpenAI.OpenAIClientOptions)'.
at Azure.AI.OpenAI.Responses.AzureResponsesClient..ctor(ClientPipeline pipeline, String deploymentName, Uri endpoint, AzureOpenAIClientOptions options)
at Azure.AI.OpenAI.AzureOpenAIClient.GetResponsesClient()
```
### Expected Behavior
_No response_
### Steps To Reproduce
Create an agent service using the following packages:
```csproj
```
### Exceptions (if any)
```
Unhandled exception. System.MissingMethodException: Method not found: 'Void OpenAI.Responses.ResponsesClient..ctor(System.ClientModel.Primitives.ClientPipeline, OpenAI.OpenAIClientOptions)'.
at Azure.AI.OpenAI.Responses.AzureResponsesClient..ctor(ClientPipeline pipeline, String deploymentName, Uri endpoint, AzureOpenAIClientOptions options)
at Azure.AI.OpenAI.AzureOpenAIClient.GetResponsesClient()
```
### Aspire doctor output
```plain
```
### Anything else?
It might be an issue that is caused by the following differences in dependency versions:
[Microsoft.Agents.AI.Hosting.OpenAI 1.21.0-alpha.260911.1](https://www.nuget.org/packages/Microsoft.Agents.AI.Hosting.OpenAI/1.21.0-alpha.260911.1):
- [OpenAI](https://www.nuget.org/packages/OpenAI/) (>= 2.13.0)
[Aspire.Azure.AI.OpenAI 13.5.4-preview.1.26464.4](https://www.nuget.org/packages/Aspire.Azure.AI.OpenAI/13.5.4-preview.1.26464.4#dependencies-body-tab):
- [Azure.AI.OpenAI](https://www.nuget.org/packages/Azure.AI.OpenAI/) (>= 2.9.0-beta.1)
- [OpenAI](https://www.nuget.org/packages/OpenAI/) (>= 2.12.0)
Also reported as https://github.com/microsoft/agent-framework/issues/7484
Seemingly related to https://github.com/Azure/azure-sdk-for-net/issues/60689
**Workaround not possible**: It might have been possible to work around this when manually specifying the OpenAI package version but that is blocked by the
> Aspire.Azure.AI.OpenAI 13.5.4-preview.1.26464.4 -> OpenAI (>= 2.12.0)
requirement
Contributor guide
Research direction
Start at AzureOpenAIClient.GetResponsesClient() and reproduce the MissingMethodException with the listed Aspire.Azure.AI.OpenAI, Microsoft.Agents.AI.Hosting.OpenAI, and OpenAI package requirements. Compare the resolved dependency versions with the Azure.AI.OpenAI and OpenAI versions named in the report; done means GetResponsesClient() can be called without the constructor mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100