Merge 9e61a4ab8c into sapling-pr-archive-ehhuang

This commit is contained in:
ehhuang 2025-10-07 19:08:53 -07:00 committed by GitHub
commit 75690a7cc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 251 additions and 36 deletions

View file

@ -67,6 +67,19 @@ class ModelsRoutingTable(CommonRoutingTableImpl, Models):
raise ValueError(f"Provider {model.provider_id} not found in the routing table")
return self.impls_by_provider_id[model.provider_id]
async def has_model(self, model_id: str) -> bool:
"""
Check if a model exists in the routing table.
:param model_id: The model identifier to check
:return: True if the model exists, False otherwise
"""
try:
await lookup_model(self, model_id)
return True
except ModelNotFoundError:
return False
async def register_model(
self,
model_id: str,