mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.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:
+178
-180
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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");
|
||||
|
||||
+4
-4
@@ -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");
|
||||
|
||||
+3
-3
@@ -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");
|
||||
|
||||
+2
-2
@@ -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");
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user