Skip to content

Conversation

TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Jul 18, 2025

Motivation and Context

We don't have a sample showing how to use a mix of agents of various types in an orchestration. This PR adds one.
A bug is also discovered in the OpenAIResponsesAgent while creating the sample.

Description

  1. Add a new sample showing how to use a mix of agents in the Handoff orchestration.
  2. Fix a bug in the OpenAIResponsesAgent where the tools were not considering the tools in the kernel instance. A new test is added too.
  3. Fix a bug in the AgentActorBase where the intermediate message callback was rejecting ChatMeesageContent type.

Contribution Checklist

@TaoChenOSU TaoChenOSU self-assigned this Jul 18, 2025
@TaoChenOSU TaoChenOSU added the python Pull requests for the Python Semantic Kernel label Jul 18, 2025
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner July 18, 2025 22:08
@github-actions github-actions bot changed the title Add mix agent orchestration sample Python: Add mix agent orchestration sample Jul 18, 2025
@moonbox3
Copy link
Collaborator

moonbox3 commented Jul 18, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
agents/open_ai
   responses_agent_thread_actions.py36212665%169, 186, 197, 208–209, 376–378, 392, 397, 404, 422–423, 427, 471–473, 476, 494–495, 504–506, 510, 514–515, 519–521, 532–534, 556, 558–559, 566–567, 569–570, 572, 574–575, 577–578, 661–663, 675–676, 678–682, 684–690, 692–701, 703–704, 708–711, 718–720, 725–726, 728–733, 735, 739–740, 742, 746, 750, 755–756, 761, 764–765, 770, 772, 833–836, 877–878, 882–884, 886, 911–912, 914–918, 920, 930–931, 939, 943, 950, 956, 1020
agents/orchestration
   agent_actor_base.py971683%51, 84–91, 93, 139, 156, 193, 219, 229, 241
TOTAL26635456682% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3655 22 💤 0 ❌ 0 🔥 1m 58s ⏱️

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

One nit, feel free to ignore

Copy link
Contributor

@crickman crickman left a comment

Choose a reason for hiding this comment

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

The .NET a sample was added that shows a mix across the different orchestrations, not just handoff. This was labeled as Step6.

https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/Orchestration/Step06_DifferentAgentTypes.cs

Normally we try to align the sample naming across platforms.

@TaoChenOSU
Copy link
Contributor Author

The .NET a sample was added that shows a mix across the different orchestrations, not just handoff. This was labeled as Step6.

https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/Orchestration/Step06_DifferentAgentTypes.cs

Normally we try to align the sample naming across platforms.

In Python, we would like to keep one sample/pattern per file. This is different from .Net where multiple tests can live in one file.

@TaoChenOSU TaoChenOSU added this pull request to the merge queue Jul 22, 2025
Merged via the queue into main with commit b723fbd Jul 22, 2025
28 checks passed
@TaoChenOSU TaoChenOSU deleted the taochen/python-add-mix-agent-orchestration-sample branch July 22, 2025 17:04
@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel Jul 22, 2025
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
We don't have a sample showing how to use a mix of agents of various
types in an orchestration. This PR adds one.
A bug is also discovered in the OpenAIResponsesAgent while creating the
sample.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Add a new sample showing how to use a mix of agents in the Handoff
orchestration.
2. Fix a bug in the OpenAIResponsesAgent where the tools were not
considering the tools in the kernel instance. A new test is added too.
3. Fix a bug in the AgentActorBase where the intermediate message
callback was rejecting ChatMeesageContent type.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents python Pull requests for the Python Semantic Kernel
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants