Description
The Scenario class in src/agentunit/core/scenario.py has hardcoded from_* methods for every adapter (OpenAI, CrewAI, AutoGen, etc.).
This violates the Open/Closed Principle. Adding a new adapter currently requires modifying the core Scenario class.
Proposed Solution
Implement an Adapter Registry or Plugin system.
Scenario should genericize instantiation or lookup adapters from a registry.
- New adapters can register themselves without touching core code.
Source
https://github.com/aviralgarg05/agentunit/blob/main/src/agentunit/core/scenario.py
Task
- Design a registry mechanism.
- Refactor
Scenario to use the registry.
- Migrate existing
from_* methods to use the registry or deprecate them in favor of a generic factory.
Description
The
Scenarioclass insrc/agentunit/core/scenario.pyhas hardcodedfrom_*methods for every adapter (OpenAI, CrewAI, AutoGen, etc.).This violates the Open/Closed Principle. Adding a new adapter currently requires modifying the core
Scenarioclass.Proposed Solution
Implement an Adapter Registry or Plugin system.
Scenarioshould genericize instantiation or lookup adapters from a registry.Source
https://github.com/aviralgarg05/agentunit/blob/main/src/agentunit/core/scenario.py
Task
Scenarioto use the registry.from_*methods to use the registry or deprecate them in favor of a generic factory.