Skip to content
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

Refactor: Enable Provider Mapping to Accept an Array of Strings for Flexibility with JSON Input #1108

Open
monilpat opened this issue Dec 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@monilpat
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently, providers need to be passed directly into the system, which limits flexibility. It prevents us from dynamically sourcing providers from external .json files or other configurations. This can become cumbersome when managing multiple providers.


Describe the solution you'd like
Refactor the current implementation to:

  • Create a provider mapping system.
  • Allow an array of strings to be passed instead of hardcoding providers directly.
  • Dynamically resolve and load providers based on the string array.
  • Enable passing in providers from a .json file for improved configurability.

Example:

{
  "providers": ["providerA", "providerB", "providerC"]
}

The system should interpret these strings, map them to their corresponding provider logic, and load them seamlessly.


Describe alternatives you've considered

  1. Hardcoding providers: This is inflexible and requires manual intervention for every change.
  2. Manual parsing of JSON: While possible, this adds unnecessary boilerplate code and duplicates logic that could be centralized.

Additional context

  • This change improves maintainability and flexibility for managing providers.
  • It is especially useful for projects that rely on external configuration files or need runtime provider adjustments.
@monilpat monilpat added the enhancement New feature or request label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant