-
Notifications
You must be signed in to change notification settings - Fork 4k
.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
base: main
Are you sure you want to change the base?
.Net: Add a new orchestration sample that uses different agent types #12665
Conversation
There was a problem hiding this 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
: renamedCreateAgent
toCreateChatCompletionAgent
, added async methodsCreateOpenAIAssistantAgentAsync
andCreateAzureAIAgentAsync
for new agent types. - Enhanced error handling in both
OpenAIAssistantChannel
andAzureAIChannel
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 namedProcessReturn
but handles refunds. Consider renaming it toProcessRefund
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.";
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseOrchestrationTest.cs
Show resolved
Hide resolved
b5703a5
to
61248ca
Compare
Motivation and Context
Description
Contribution Checklist