Skip to content

Improve console output for handoff and magentic workflows#31

Merged
pamelafox merged 1 commit intoAzure-Samples:mainfrom
pamelafox:advtweaks
Mar 4, 2026
Merged

Improve console output for handoff and magentic workflows#31
pamelafox merged 1 commit intoAzure-Samples:mainfrom
pamelafox:advtweaks

Conversation

@pamelafox
Copy link
Copy Markdown
Contributor

Changes

Handoff examples (workflow_handoffbuilder.py)

  • Replaced logger + RichHandler with rich.console.Console for cleaner, consistent output
  • Uses emoji-styled output: 🔀 for handoffs, 🤖 for agent headers, bold prompt label

Handoff rules examples (workflow_handoffbuilder_rules.py)

  • Switched from non-streaming await workflow.run() to streaming, so handoffs are visible as they happen
  • Added initiate_return and process_refund tools so return/refund agents take action instead of just chatting
  • Simplified agent instructions to avoid excessive info-gathering (agents no longer ask 10+ questions)
  • Expanded sample prompt with full order details (item description, price, refund method)
  • Spanish termination condition uses "adiós" instead of "goodbye"

MagenticOne example (workflow_magenticone.py)

  • Added handling for executor_completed events to display each participant agent's output (was previously silent)
  • Agent responses shown in cyan panels with agent name

Spanish translations

  • All changes mirrored in /examples/spanish/ counterparts

- Switch handoff examples from logger to rich Console for consistent output
- Add streaming with handoff/agent display to handoffbuilder_rules
- Add initiate_return and process_refund tools to handoffbuilder_rules
- Improve agent prompts to avoid excessive info requests
- Provide more detailed sample prompts
- Show participant agent output in MagenticOne via executor_completed events
- Update Spanish translations to match all changes
@madebygps
Copy link
Copy Markdown
Collaborator

lgtm

@pamelafox pamelafox merged commit 3835975 into Azure-Samples:main Mar 4, 2026
1 check passed
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.

2 participants