-
Notifications
You must be signed in to change notification settings - Fork 891
.NET: Make DelegatingAIAgent abstract #2797
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?
Conversation
Co-authored-by: SergeyMenshykh <[email protected]>
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 makes the DelegatingAIAgent class abstract to enforce its intended design as a base class for the decorator pattern. The class was always designed to be inherited (protected constructor, pass-through behavior), and making it abstract prevents direct instantiation while maintaining full compatibility with all existing inheritors.
- Changed class declaration from
public classtopublic abstract class
Motivation and Context
DelegatingAIAgentimplements the decorator pattern as a base class for composable agent pipelines. It was designed to be inherited, not instantiated directly - it has a protected constructor and only provides pass-through behavior. Making it abstract enforces this design intent.Contributes to: #2542
Description
Changed the class declaration from
public classtopublic abstract class:This prevents direct instantiation while maintaining full compatibility with all inheriting classes:
AnonymousDelegatingAIAgent,LoggingAgent,OpenTelemetryAgent,EntityAgentWrapper, and various sample implementations.Contribution Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.