Skip to content

Commit 78d1184

Browse files
elbrunoCopilot
andcommitted
fix: address Copilot PR review suggestions
- Add null guards with setup hints for config values (MAF01, MAF02, AIFoundry-01, ImageGen-02) - Fix AsAgent() -> AsAIAgent() in Lesson 04 workflow docs (7 instances) - Fix XML doc comment AgentThread -> AgentSession in Persisting-02-Menu - Localize Spanish translation (April -> abril, production-ready -> listos para producción) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0b2f648 commit 78d1184

8 files changed

Lines changed: 23 additions & 17 deletions

File tree

04-AgentsWithMAF/03-multi-agent-workflows.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ AIAgent editor = chatClient.AsAIAgent(
7979
Workflow workflow = AgentWorkflowBuilder.BuildSequential(writer, editor);
8080

8181
// Run the workflow
82-
AIAgent workflowAgent = workflow.AsAgent();
82+
AIAgent workflowAgent = workflow.AsAIAgent();
8383

8484
AgentResponse response = await workflowAgent.RunAsync(
8585
"Write a short story about a haunted house.");
@@ -112,7 +112,7 @@ AIAgent factChecker = chatClient.AsAIAgent(
112112
Workflow pipeline = AgentWorkflowBuilder.BuildSequential(
113113
researcher, writer, editor, factChecker);
114114

115-
var response = await pipeline.AsAgent().RunAsync(
115+
var response = await pipeline.AsAIAgent().RunAsync(
116116
"Create an article about the history of quantum computing.");
117117
```
118118

@@ -139,7 +139,7 @@ AIAgent keywordExtractor = chatClient.AsAIAgent(
139139
Workflow concurrent = AgentWorkflowBuilder.BuildConcurrent(
140140
sentimentAnalyst, summaryAgent, keywordExtractor);
141141

142-
var response = await concurrent.AsAgent().RunAsync("""
142+
var response = await concurrent.AsAIAgent().RunAsync("""
143143
The new product launch exceeded all expectations. Sales were
144144
up 200% compared to last year, and customer feedback has been
145145
overwhelmingly positive. The marketing team's innovative
@@ -192,7 +192,7 @@ Workflow handoff = AgentWorkflowBuilder.CreateHandoffBuilderWith(generalSupport)
192192
.Build();
193193

194194
// First query goes to GeneralSupport, which may route to specialists
195-
var response = await handoff.AsAgent().RunAsync(
195+
var response = await handoff.AsAIAgent().RunAsync(
196196
"I was charged twice for my subscription last month.");
197197
```
198198

@@ -246,7 +246,7 @@ AIAgent reviewer = ollamaClient.AsAIAgent(
246246
Workflow multiModel = AgentWorkflowBuilder.BuildSequential(
247247
researcher, writer, reviewer);
248248

249-
var response = await multiModel.AsAgent().RunAsync(
249+
var response = await multiModel.AsAIAgent().RunAsync(
250250
"Create an article about renewable energy innovations.");
251251
```
252252

@@ -300,7 +300,7 @@ Workflow customWorkflow = AgentWorkflowBuilder.CreateHandoffBuilderWith(intakeAg
300300
.WithHandoff(complexAgent, responderAgent)
301301
.Build();
302302

303-
var response = await customWorkflow.AsAgent().RunAsync(
303+
var response = await customWorkflow.AsAIAgent().RunAsync(
304304
"Explain quantum entanglement in detail with mathematical formulations.");
305305

306306
Console.WriteLine(response.Text);

04-AgentsWithMAF/04-model-context-protocol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ AIAgent documenter = chatClient.AsAIAgent(
356356
Workflow devWorkflow = AgentWorkflowBuilder.BuildSequential(
357357
researcher, coder, documenter);
358358

359-
await devWorkflow.AsAgent().RunAsync(
359+
await devWorkflow.AsAIAgent().RunAsync(
360360
"Research best practices for error handling, implement them, and document the changes.");
361361
```
362362

samples/MAF/MAF-AIFoundry-01/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
using Microsoft.Extensions.AI;
55
using Microsoft.Extensions.Configuration;
66

7-
var config= new ConfigurationBuilder().AddUserSecrets<Program>().Build();
8-
var endpoint = config["AzureOpenAI:Endpoint"];
7+
var config = new ConfigurationBuilder().AddUserSecrets<Program>().Build();
8+
var endpoint = config["AzureOpenAI:Endpoint"] ?? throw new InvalidOperationException(
9+
"Missing 'AzureOpenAI:Endpoint'. Run: dotnet user-secrets set \"AzureOpenAI:Endpoint\" \"https://<your-resource>.openai.azure.com/\"");
910
var deploymentName = config["AzureOpenAI:Deployment"] ?? "gpt-5-mini";
1011

1112
IChatClient chatClient =

samples/MAF/MAF-ImageGen-02/ImageGenerator.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ public static async Task<string> GenerateImageFromPrompt(
2525
.Build();
2626

2727
// You will need to set these environment variables or edit the following values.
28-
var endpoint = config["AzureOpenAI:Endpoint"];
29-
var deployment = config["FLUX_DEPLOYMENT_NAME"];
30-
var apiKey = config["AZURE_OPENAI_API_KEY"];
28+
var endpoint = config["AzureOpenAI:Endpoint"] ?? throw new InvalidOperationException(
29+
"Missing 'AzureOpenAI:Endpoint'. Run: dotnet user-secrets set \"AzureOpenAI:Endpoint\" \"https://<your-resource>.openai.azure.com/\"");
30+
var deployment = config["FLUX_DEPLOYMENT_NAME"] ?? throw new InvalidOperationException(
31+
"Missing 'FLUX_DEPLOYMENT_NAME'. Run: dotnet user-secrets set \"FLUX_DEPLOYMENT_NAME\" \"<your-flux-deployment>\"");
32+
var apiKey = config["AZURE_OPENAI_API_KEY"] ?? throw new InvalidOperationException(
33+
"Missing 'AZURE_OPENAI_API_KEY'. Run: dotnet user-secrets set \"AZURE_OPENAI_API_KEY\" \"<your-api-key>\"");
3134

3235
// Ensure endpoint ends with /openai/v1/
3336
if (!endpoint.EndsWith("/openai/v1/"))

samples/MAF/MAF-Persisting-02-Menu/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static async Task OptionLoadAndContinue(AIAgent agent)
104104
/// <summary>
105105
/// Unified interaction function: prompts the user for a question, runs the agent using the provided thread,
106106
/// prints the response using StreamConsoleHelper, and optionally persists the thread to disk.
107-
/// The function returns the (possibly updated) AgentThread so callers can continue working with it.
107+
/// The function returns the (possibly updated) AgentSession so callers can continue working with it.
108108
/// </summary>
109109
private static async Task<AgentSession> RunQuestionWithThread(AIAgent agent, AgentSession thread, bool persistAfter)
110110
{

samples/MAF/MAF01/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
using Microsoft.Extensions.Configuration;
66

77
var config = new ConfigurationBuilder().AddUserSecrets<Program>().Build();
8-
var endpoint = config["AzureOpenAI:Endpoint"];
8+
var endpoint = config["AzureOpenAI:Endpoint"] ?? throw new InvalidOperationException(
9+
"Missing 'AzureOpenAI:Endpoint'. Run: dotnet user-secrets set \"AzureOpenAI:Endpoint\" \"https://<your-resource>.openai.azure.com/\"");
910
var deploymentName = config["AzureOpenAI:Deployment"] ?? "gpt-5-mini";
1011

1112
IChatClient chatClient =

samples/MAF/MAF02/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
using Microsoft.Extensions.Configuration;
77

88
var config = new ConfigurationBuilder().AddUserSecrets<Program>().Build();
9-
var endpoint = config["AzureOpenAI:Endpoint"];
9+
var endpoint = config["AzureOpenAI:Endpoint"] ?? throw new InvalidOperationException(
10+
"Missing 'AzureOpenAI:Endpoint'. Run: dotnet user-secrets set \"AzureOpenAI:Endpoint\" \"https://<your-resource>.openai.azure.com/\"");
1011
var deploymentName = config["AzureOpenAI:Deployment"] ?? "gpt-5-mini";
1112

1213
IChatClient chatClient =

translations/es/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ No olvides [darle una estrella (🌟) a este repositorio](https://docs.github.co
3131

3232
Estamos mejorando constantemente este curso con las últimas herramientas de IA, modelos y ejemplos prácticos:
3333

34-
- **🚀 Microsoft Agent Framework v1.0 GA (April 2026)**
34+
- **🚀 Microsoft Agent Framework v1.0 GA (abril de 2026)**
3535

3636
Todos los 28 ejemplos de MAF se han actualizado de preview a paquetes **estables v1.0**. Esto incluye un **cambio de ruptura:** `Microsoft.Agents.AI.AzureAI` ha sido renombrado a `Microsoft.Agents.AI.Foundry`.
3737

3838
**2 nuevos escenarios de Hosted Agent** — Implementa agentes containerizados en Azure Foundry Agent Service:
3939
- [MAF-HostedAgent-01-TimeZone](samples/MAF/MAF-HostedAgent-01-TimeZone/) — Agente alojado simple con herramienta de zona horaria
4040
- [MAF-HostedAgent-02-MultiAgent](samples/MAF/MAF-HostedAgent-02-MultiAgent/) — Flujo de trabajo de Asistente de Investigación Multi-Agente
4141

42-
Los flujos de trabajo multi-agente, streaming, persistencia y MCP son ahora production-ready.
42+
Los flujos de trabajo multi-agente, streaming, persistencia y MCP están ahora listos para producción.
4343

4444
👉 [Official GA Release](https://github.com/microsoft/agent-framework/releases/tag/dotnet-1.0.0) | [Foundry Agent Service GA](https://devblogs.microsoft.com/foundry/foundry-agent-service-ga/)
4545

0 commit comments

Comments
 (0)