Skip to content

Local tool simplification #399

Merged
MehakBindra merged 6 commits intomainfrom
mehak/msft-ai-sample
Apr 23, 2026
Merged

Local tool simplification #399
MehakBindra merged 6 commits intomainfrom
mehak/msft-ai-sample

Conversation

@MehakBindra
Copy link
Copy Markdown
Contributor

@MehakBindra MehakBindra commented Apr 22, 2026

Looking back, this sample is severely overloaded compared to the other examples. Simplifying the local tools to have one simple welcome adaptive card. I think we should include graph and oauth capabilities with more thought at a later time in a more complex sample.

Key changes include:

Local tool simplification and onboarding improvements

  • Replaced all Microsoft Graph-backed local tools (find_people, get_org_context, list_team_members, get_presence) with a single local tool, send_welcome_card, which attaches a capabilities overview Adaptive Card to greet users. The new tool uses a ContextVar to safely manage per-turn card attachments. (src/local_tools.py)
  • Updated the agent's system prompt to always greet new users with a welcome card, aligning agent behavior with the new onboarding experience. (src/agent.py)

Documentation and environment updates

  • Updated the README.md to reflect the removal of Microsoft Graph tools, focusing on the new welcome card tool and simplifying instructions for environment variables and prerequisites. Microsoft Graph permissions and related setup steps have been removed. (README.md)
  • Removed the msgraph-sdk dependency from pyproject.toml since Graph-backed tools are no longer used. (pyproject.toml)

Codebase cleanup and integration

  • Removed all code related to binding the Teams App to Microsoft Graph and cleaned up logging configuration. Updated the message handling flow to collect and attach Adaptive Cards generated by tools to the Teams reply.

Copilot AI review requested due to automatic review settings April 22, 2026 22:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the examples/ai-agentframework sample by removing Microsoft Graph–backed local tools and replacing them with a single onboarding-focused local tool that attaches a welcome Adaptive Card to the reply.

Changes:

  • Removed Graph tooling (msgraph-sdk dependency + Graph tool implementations) and associated app binding.
  • Added a send_welcome_card local tool that queues Adaptive Card attachments via a per-turn ContextVar.
  • Updated the agent instructions and README to reflect the new onboarding/welcome-card experience.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Removes msgraph-sdk from the locked dependency set.
examples/ai-agentframework/src/main.py Introduces per-turn card collection and attaches queued cards to the final streamed reply.
examples/ai-agentframework/src/local_tools.py Replaces Graph tools with send_welcome_card and a ContextVar-backed card queue.
examples/ai-agentframework/src/agent.py Updates system instructions to greet new users with a welcome card.
examples/ai-agentframework/pyproject.toml Drops msgraph-sdk dependency for the example.
examples/ai-agentframework/README.md Updates documentation to remove Graph setup and describe the welcome-card tool.

Comment thread examples/ai-agentframework/README.md Outdated
Comment thread examples/ai-agentframework/README.md Outdated
Comment thread examples/ai-agentframework/src/local_tools.py Outdated
Comment thread examples/ai-agentframework/src/local_tools.py Outdated
MehakBindra and others added 3 commits April 22, 2026 15:05
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>
Comment thread examples/ai-agentframework/src/local_tools.py Outdated
Copy link
Copy Markdown
Collaborator

@lilyydu lilyydu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after addressing Aamir's comment above!

@MehakBindra MehakBindra merged commit 35df5b1 into main Apr 23, 2026
4 checks passed
@MehakBindra MehakBindra deleted the mehak/msft-ai-sample branch April 23, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants