Python: Add sample to show handoff as agent with HITL#2534
Merged
moonbox3 merged 6 commits intomicrosoft:mainfrom Dec 2, 2025
Merged
Python: Add sample to show handoff as agent with HITL#2534moonbox3 merged 6 commits intomicrosoft:mainfrom
moonbox3 merged 6 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive Python sample demonstrating how to use HandoffBuilder workflows as agents with human-in-the-loop (HITL) interactions, addressing issue #2446.
Key Changes:
- Implements a handoff workflow pattern that converts to an agent interface using
.as_agent() - Demonstrates the FunctionCallContent/FunctionResultContent pattern for HITL in handoff workflows
- Shows triage-to-specialist routing with user input requests handled through the standard agent interface
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/samples/getting_started/workflows/agents/handoff_workflow_as_agent.py | New sample file demonstrating HandoffBuilder workflow as agent with HITL, including comprehensive documentation, helper functions for extracting handoff requests, and a multi-turn conversation demo with scripted responses |
| python/samples/getting_started/workflows/README.md | Added entry for the new handoff workflow as agent sample in the agents section table |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Member
moonbox3
commented
Dec 1, 2025
eavanvalkenburg
approved these changes
Dec 1, 2025
alliscode
approved these changes
Dec 1, 2025
moonbox3
commented
Dec 2, 2025
alliscode
approved these changes
Dec 2, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
* Add sample to show handoff as agent with HITL * Update uv.lock with latest pkg versions. Fix lint error. * Upgrade grpcio to 1.76.0 * Handle grpcio versions * Case insensitive compare for declarative
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.
Motivation and Context
We're missing a sample with the
Handoffpattern showing how to use it as an agent as well as handle HITL.Description
Contribution Checklist