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
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
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