Skip to content

.Net: Add a new orchestration sample that uses different agent types #12665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

markwallace-microsoft
Copy link
Member

Motivation and Context

Description

Contribution Checklist

@markwallace-microsoft markwallace-microsoft requested a review from a team as a code owner July 3, 2025 09:28
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Jul 3, 2025
@github-actions github-actions bot changed the title Add a new orchestration sample that uses different agent types .Net: Add a new orchestration sample that uses different agent types Jul 3, 2025
Copy link
Contributor

@Copilot 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 introduces a new orchestration sample that demonstrates using different agent types and refactors how agents are created and handled in existing tests and channels.

  • Refactor in BaseOrchestrationTest: renamed CreateAgent to CreateChatCompletionAgent, added async methods CreateOpenAIAssistantAgentAsync and CreateAzureAIAgentAsync for new agent types.
  • Enhanced error handling in both OpenAIAssistantChannel and AzureAIChannel with unified exception messages and empty‐message filtering in message factories.
  • Added Step06_DifferentAgentTypes sample covering concurrent, sequential, group chat, and handoff orchestrations with diverse agent implementations.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseOrchestrationTest.cs Refactored agent-creation API and added new async factory methods.
dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs Wrapped channel send errors and rethrew with a consistent message.
dotnet/src/Agents/AzureAI/AzureAIChannel.cs Similar error wrapping plus a catch-all for unexpected exceptions.
dotnet/src/Agents/OpenAI/Internal/AssistantMessageFactory.cs Added logic to skip empty text messages.
dotnet/src/Agents/AzureAI/Internal/AgentMessageFactory.cs Added logic to skip empty text messages.
dotnet/samples/GettingStartedWithAgents/Orchestration/Step06_DifferentAgentTypes.cs New sample showcasing multiple orchestration patterns with varied agent types.
(other samples) Updated calls from CreateAgent to CreateChatCompletionAgent and corrected typos.
Comments suppressed due to low confidence (1)

dotnet/samples/GettingStartedWithAgents/Orchestration/Step06_DifferentAgentTypes.cs:307

  • [nitpick] In OrderRefundPlugin, the method is named ProcessReturn but handles refunds. Consider renaming it to ProcessRefund to clearly reflect its purpose and avoid confusion with the return plugin.
        public string ProcessReturn(string orderId, string reason) => $"Refund for order {orderId} has been processed successfully.";

@markwallace-microsoft markwallace-microsoft force-pushed the users/markwallace/orchestration_agent_types_samples branch from b5703a5 to 61248ca Compare July 3, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants