.NET: Simplify A2A function tool samples - #7861
Conversation
Split whole-agent and per-skill function tool concepts into focused samples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 31ff03bb-ffc6-43ba-be4a-7b235c3c7da9
There was a problem hiding this comment.
Pull request overview
Splits the A2A function-tool example into two focused samples: one exposing an entire agent and another exposing advertised skills individually.
Changes:
- Adds the single-agent
AsAIFunction()sample. - Retains skill-based tool generation as a dedicated sample.
- Updates documentation and solution registration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
dotnet/samples/02-agents/A2A/README.md |
Lists both focused samples. |
dotnet/samples/02-agents/A2A/A2AAgent_Skills/README.md |
Documents skill-based tools. |
dotnet/samples/02-agents/A2A/A2AAgent_Skills/Program.cs |
Clarifies the skill-tool sample. |
dotnet/samples/02-agents/A2A/A2AAgent_Skills/A2AAgent_Skills.csproj |
Defines the skills sample project. |
dotnet/samples/02-agents/A2A/A2AAgent_AsFunctionTool/README.md |
Documents the single-tool approach. |
dotnet/samples/02-agents/A2A/A2AAgent_AsFunctionTool/Program.cs |
Demonstrates AsAIFunction(). |
dotnet/agent-framework-dotnet.slnx |
Registers both sample projects. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): fedcd8b6a9b4
Model: gpt-5.6-sol
Overview
The PR cleanly separates the whole-agent and per-skill function-tool examples, updates their solution and documentation references, and preserves cancellation and per-call session behavior from the existing adapters. The skill sample also guards nullable metadata and sanitizes advertised skill names. The whole-agent sample still forwards the remote card's unconstrained agent name into an Azure OpenAI function declaration, which can prevent otherwise valid A2A agents from being used.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/samples/02-agents/A2A/A2AAgent_AsFunctionTool/Program.cs
Replace the Azure OpenAI setup with the canonical Foundry project client in both A2A samples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 31ff03bb-ffc6-43ba-be4a-7b235c3c7da9
Motivation & Context
The existing A2A function tools sample demonstrates two concepts at once: exposing an entire A2A agent as one function tool and representing its advertised skills as separate function tools. Splitting these concepts makes each sample easier to understand and gives users a focused starting point for either approach.
Description & Review Guide
A2AAgent_AsFunctionTooland simplified it to demonstrateAsAIFunction(). AddedA2AAgent_Skillsfor generating function tools from advertised A2A skills. Updated the sample index, documentation, and solution entries.Related Issue
No related issue. No matching open issue or pull request was found.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.