mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
refactor & cleanup
This commit is contained in:
parent
5d3c02d0fb
commit
bce79617bf
3 changed files with 13 additions and 10 deletions
|
@ -16,6 +16,10 @@ def instantiate_class_type(fully_qualified_name):
|
|||
return getattr(module, class_name)
|
||||
|
||||
|
||||
def is_models_router_provider(item: Any):
|
||||
return isinstance(item, str) and item == "models-router"
|
||||
|
||||
|
||||
# returns a class implementing the protocol corresponding to the Api
|
||||
async def instantiate_provider(
|
||||
provider_spec: ProviderSpec,
|
||||
|
@ -51,7 +55,7 @@ async def instantiate_provider(
|
|||
|
||||
config = None
|
||||
args = [inner_impls, deps]
|
||||
elif isinstance(provider_config, str) and provider_config == "models-router":
|
||||
elif is_models_router_provider(provider_config):
|
||||
config = None
|
||||
assert len(deps) == 1 and Api.models in deps
|
||||
args = [deps[Api.models]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue