Skip to content

.NET: [Bug]: missing method GetResponseClient #6401

Description

@massnonn

Description

on the guide https://learn.microsoft.com/en-us/agent-framework/agents/providers/azure-openai?pivots=programming-language-csharp is present example code which describe is recommended use Responses. this is the example :
AzureOpenAIClient client = new AzureOpenAIClient(
new Uri("https://.openai.azure.com"),
new DefaultAzureCredential());
var responsesClient = client.GetResponseClient("gpt-4o-mini");

AIAgent agent = responsesClient.AsAIAgent(
instructions: "You are a helpful coding assistant.",
name: "CodeHelper");

Console.WriteLine(await agent.RunAsync("Write a Python function to sort a list."));
But the method GetResponseClient is not present but only GetResponsesClient without arguments

Code Sample

AzureOpenAIClient client = new AzureOpenAIClient(
    new Uri("https://<myresource>.openai.azure.com"),
    new DefaultAzureCredential());
var responsesClient = client.GetResponseClient("gpt-4o-mini");

AIAgent agent = responsesClient.AsAIAgent(
    instructions: "You are a helpful coding assistant.",
    name: "CodeHelper");

Console.WriteLine(await agent.RunAsync("Write a Python function to sort a list."));

Error Messages / Stack Traces

not definition present for GetResponseClient

Package Versions

Azure.AI.OpenAI Version="2.9.0-beta.1" Azure.Identity" Version="1.21.0" Microsoft.Agents.AI.OpenAI Version="1.9.0"

.NET Version

NET 10

Additional Context

No response

Metadata

Metadata

Assignees

Labels

.NETUsage: [Issues, PRs], Target: .NetbugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions