Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new examples/a2a-test sample that demonstrates two symmetric Microsoft Teams bots (Alice/Bob) exchanging “ask” and “reply” messages over A2A, using Adaptive Cards for human-in-the-loop responses.
Changes:
- Introduces modular A2A components (
a2a_client,a2a_executor,a2a_server) plus shared Adaptive Card builders and a small in-memory bot state object. - Adds two runnable bot entrypoints (
bot_a.py,bot_b.py) that can both send “ask” requests and handle “reply” callbacks. - Updates the example README and
pyproject.tomldependencies to match the new architecture.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/a2a-test/src/state.py | Adds BotState for operator conversation tracking and outbound qid→conversation mapping. |
| examples/a2a-test/src/cards.py | Adds Adaptive Card builders for ask/reply with embedded routing metadata. |
| examples/a2a-test/src/a2a_client.py | Adds a simple one-shot outbound A2A sender using a2a-sdk + httpx. |
| examples/a2a-test/src/a2a_executor.py | Adds server-side A2A dispatch logic for ask/reply and pushes cards into Teams. |
| examples/a2a-test/src/a2a_server.py | Wraps the executor in an A2AStarletteApplication and exposes an agent card/handler. |
| examples/a2a-test/src/bot_a.py | Adds Alice bot: Teams handler + A2A server + card-action reply routing. |
| examples/a2a-test/src/bot_b.py | Adds Bob bot: symmetric to Alice with separate ports and peer config. |
| examples/a2a-test/src/main.py | Removes the prior single-file weather-oriented sample implementation. |
| examples/a2a-test/pyproject.toml | Renames the example project and updates dependencies for the new approach. |
| examples/a2a-test/README.md | Documents the new two-bot flow, file structure, and run instructions. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…utor.py (Ruff B018) Agent-Logs-Url: https://github.com/microsoft/teams.py/sessions/ceb8bbad-5e0d-4c3e-ae9e-9436b3a2ac1e Co-authored-by: MehakBindra <83925928+MehakBindra@users.noreply.github.com>
…in bot_b.py Agent-Logs-Url: https://github.com/microsoft/teams.py/sessions/45ac9cb6-3bfe-47e4-aefe-d18efa2cb742 Co-authored-by: MehakBindra <83925928+MehakBindra@users.noreply.github.com>
lilyydu
reviewed
Apr 23, 2026
heyitsaamir
reviewed
Apr 23, 2026
lilyydu
reviewed
Apr 24, 2026
heyitsaamir
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new example in
examples/a2a-testdemonstrating two symmetric Microsoft Teams bots (Alice and Bob) that relay questions and answers using the officiala2a-sdkand Adaptive Cards. The implementation is modularized into clear components for A2A communication, card construction, bot logic, and state management. The README and dependencies are updated to reflect the new architecture and usage.The most important changes are:
New A2A Example Architecture and Implementation
bot_a.pyandbot_b.py) that can relay questions to each other over A2A, using Adaptive Cards for human-in-the-loop answers. Each bot can both send and receive questions, and route replies back to the original asker. [1] [2]A2A Communication Layer
a2a_client.pyfor outbound A2A message sending, which resolves the peer’s agent card and sends a single message using thea2a-sdk.a2a_executor.pyimplementing anAgentExecutorthat routes incoming A2Aaskandreplymessages to the appropriate Teams conversation, updating bot state as needed.a2a_server.pyto wrap the executor in anA2AStarletteApplicationfor serving A2A requests.Adaptive Card Construction
cards.pywith builder functions for the "ask" and "reply" Adaptive Cards, embedding routing metadata so no per-question state is needed on the receiving bot.Documentation and Dependency Updates
README.mdto document the new flow, file structure, operator requirements, and setup instructions.pyproject.tomlto reflect new dependencies (a2a-sdk,uvicorn,httpx, etc.) and renamed the package for clarity.