Skip to content

Refactor Scenario to Decouple Adapters #61

@aviralgarg05

Description

@aviralgarg05

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitectural changes and designhelp wantedExtra attention is neededrefactorCode refactoring and architectural changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions