test: add comprehensive tests for enhanced model registration and lookup

- Add 3 new test cases covering alias registration, multi-provider disambiguation, and fallback lookup
- Update existing tests to work with new namespaced identifier behavior
- Improve error message with disambiguation guidance
- Fix linting issues with assert statements
This commit is contained in:
Ashwin Bharambe 2025-07-22 09:21:17 -07:00
parent 352bf3ec56
commit d3dee496ec
2 changed files with 144 additions and 10 deletions

View file

@ -68,7 +68,8 @@ class ModelsRoutingTable(CommonRoutingTableImpl, Models):
provider_id = list(self.impls_by_provider_id.keys())[0]
else:
raise ValueError(
f"Please specify a provider_id for model {model_id} since multiple providers are available: {self.impls_by_provider_id.keys()}"
f"Please specify a provider_id for model {model_id} since multiple providers are available: {self.impls_by_provider_id.keys()}.\n\n"
"Use the provider_id as a prefix to disambiguate, e.g. 'provider_id/model_id'."
)
provider_model_id = provider_model_id or model_id