mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-15 22:47:59 +00:00
small fix
This commit is contained in:
parent
984ba074e1
commit
a7f728e41c
3 changed files with 15 additions and 11 deletions
|
@ -5,7 +5,6 @@
|
|||
# the root directory of this source tree.
|
||||
import importlib
|
||||
import inspect
|
||||
import sys
|
||||
|
||||
from typing import Any, Dict, List, Set
|
||||
|
||||
|
@ -34,6 +33,10 @@ from llama_stack.distribution.store import DistributionRegistry
|
|||
from llama_stack.distribution.utils.dynamic import instantiate_class_type
|
||||
|
||||
|
||||
class InvalidProviderError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def api_protocol_map() -> Dict[Api, Any]:
|
||||
return {
|
||||
Api.agents: Agents,
|
||||
|
@ -105,7 +108,7 @@ async def resolve_impls(
|
|||
p = provider_registry[api][provider.provider_type]
|
||||
if p.deprecation_error:
|
||||
cprint(p.deprecation_error, "red", attrs=["bold"])
|
||||
sys.exit(1)
|
||||
raise InvalidProviderError(p.deprecation_error)
|
||||
|
||||
elif p.deprecation_warning:
|
||||
cprint(
|
||||
|
@ -116,7 +119,7 @@ async def resolve_impls(
|
|||
p.deps__ = [a.value for a in p.api_dependencies]
|
||||
spec = ProviderWithSpec(
|
||||
spec=p,
|
||||
**(provider.dict()),
|
||||
**(provider.model_dump()),
|
||||
)
|
||||
specs[provider.provider_id] = spec
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue