Skip to content

Commit

Permalink
Add ToDos for provider enum and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nachollorca authored Jan 19, 2025
1 parent dcfcec4 commit b372a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/agilm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __post_init__(self):
# check if provider is supported
self.provider = self.provider.lower()
dir = Path(__file__).parent.resolve()
# ToDo: make providers an Enum too?
# ToDo: make providers an Enum so user can access with `providers.`
providers = [provider.split(".")[0] for provider in os.listdir(f"{dir}/providers") if provider.endswith(".py")]
if self.provider not in providers:
raise ValueError(f"Provider {self.provider} is not supported: {providers}.")
Expand All @@ -118,7 +118,7 @@ def __post_init__(self):
module = import_module(f"agilm.providers.{self.provider}")
provider = getattr(module, f"{self.provider.capitalize()}")()
if self.id not in provider.model_ids:
raise ValueError(f"Provider {self.provider} does not support model {self.id}: {provider.model_ids}")
raise ValueError(f"Provider {self.provider} does not support model {self.id}: {provider.model_ids}") # ToDo: warn instead of raise

# check if locations are supported
if self.locations:
Expand Down

0 comments on commit b372a1a

Please sign in to comment.