Skip to content

Conversation

@pescheck-bram
Copy link
Contributor

This PR refactors the model selection and handling logic by splitting the model manager into provider-specific classes, aiming to reduce complexity and improve modularity.

What’s changed

  • Created dedicated provider classes:

    • openai_provider.py
    • azure_openai_provider.py
    • anthropic_provider.py
    • deepseek_provider.py
  • Introduced a base.py with a common provider interface (BaseProvider)

  • Added a registry.py to dynamically resolve and initialize providers

  • Updated model_manager.py to delegate model usage to registered provider classes instead of conditionals

  • Updated all references accordingly to use the new structure

Benefits

  • Eliminates if/else or match logic for provider selection
  • Makes it easier to add new providers (just implement a new class and register it)
  • Improves readability, testability, and long-term maintainability

@pescheck-bram pescheck-bram merged commit 60c0bbf into main Jun 25, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant