.NET: Update Foundry Agents to latest 2.0.0 alpha.20251107.3 (#2050)

* Update extensions for new CreateVersionOptions structure

* Update unit tests

* Addresss capitalized
This commit is contained in:
Roger Barreto
2025-11-10 15:40:37 +00:00
committed by GitHub
parent fb1f4e2799
commit 68f79d8bea
17 changed files with 353 additions and 366 deletions
File diff suppressed because it is too large Load Diff
@@ -23,10 +23,10 @@ internal sealed class FunctionToolAgentProvider(IConfiguration configuration) :
AIFunctionFactory.Create(menuPlugin.GetItemPrice),
];
AgentsClient agentsClient = new(foundryEndpoint, new AzureCliCredential());
AgentClient agentClient = new(foundryEndpoint, new AzureCliCredential());
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "MenuAgent",
agentDefinition: this.DefineMenuAgent(functions),
agentDescription: "Provides information about the restaurant menu");
@@ -13,22 +13,22 @@ internal sealed class MarketingAgentProvider(IConfiguration configuration) : Age
{
protected override async IAsyncEnumerable<AgentVersion> CreateAgentsAsync(Uri foundryEndpoint)
{
AgentsClient agentsClient = new(foundryEndpoint, new AzureCliCredential());
AgentClient agentClient = new(foundryEndpoint, new AzureCliCredential());
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "AnalystAgent",
agentDefinition: this.DefineAnalystAgent(),
agentDescription: "Analyst agent for Marketing workflow");
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "WriterAgent",
agentDefinition: this.DefineWriterAgent(),
agentDescription: "Writer agent for Marketing workflow");
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "EditorAgent",
agentDefinition: this.DefineEditorAgent(),
agentDescription: "Editor agent for Marketing workflow");
@@ -13,16 +13,16 @@ internal sealed class MathChatAgentProvider(IConfiguration configuration) : Agen
{
protected override async IAsyncEnumerable<AgentVersion> CreateAgentsAsync(Uri foundryEndpoint)
{
AgentsClient agentsClient = new(foundryEndpoint, new AzureCliCredential());
AgentClient agentClient = new(foundryEndpoint, new AzureCliCredential());
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "StudentAgent",
agentDefinition: this.DefineStudentAgent(),
agentDescription: "Student agent for MathChat workflow");
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "TeacherAgent",
agentDefinition: this.DefineTeacherAgent(),
agentDescription: "Teacher agent for MathChat workflow");
@@ -13,10 +13,10 @@ internal sealed class TestAgentProvider(IConfiguration configuration) : AgentPro
{
protected override async IAsyncEnumerable<AgentVersion> CreateAgentsAsync(Uri foundryEndpoint)
{
AgentsClient agentsClient = new(foundryEndpoint, new AzureCliCredential());
AgentClient agentClient = new(foundryEndpoint, new AzureCliCredential());
yield return
await agentsClient.CreateAgentAsync(
await agentClient.CreateAgentAsync(
agentName: "TestAgent",
agentDefinition: this.DefineMenuAgent(),
agentDescription: "Provides information about the restaurant menu");
@@ -42,7 +42,7 @@ public sealed class MediaInputTest(ITestOutputHelper output) : IntegrationTest(o
public async Task ValidateImageUploadAsync()
{
byte[] imageData = await DownloadFileAsync();
AgentsClient client = new(this.TestEndpoint, new AzureCliCredential());
AgentClient client = new(this.TestEndpoint, new AzureCliCredential());
using MemoryStream contentStream = new(imageData);
OpenAIFileClient fileClient = client.GetOpenAIClient().GetOpenAIFileClient();
OpenAIFile fileInfo = await fileClient.UploadFileAsync(contentStream, "basic-text.pdf", FileUploadPurpose.Assistants);