mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
Stop asking for "apis to serve" as part of configure
This commit is contained in:
parent
eea0a83bd1
commit
055770a791
2 changed files with 2 additions and 13 deletions
|
@ -17,12 +17,6 @@ from llama_stack.distribution.utils.dynamic import instantiate_class_type
|
||||||
from llama_stack.distribution.utils.prompt_for_config import prompt_for_config
|
from llama_stack.distribution.utils.prompt_for_config import prompt_for_config
|
||||||
|
|
||||||
|
|
||||||
# These are hacks so we can re-use the `prompt_for_config` utility
|
|
||||||
# This needs a bunch of work to be made very user friendly.
|
|
||||||
class ReqApis(BaseModel):
|
|
||||||
apis_to_serve: List[str]
|
|
||||||
|
|
||||||
|
|
||||||
def make_routing_entry_type(config_class: Any):
|
def make_routing_entry_type(config_class: Any):
|
||||||
class BaseModelWithConfig(BaseModel):
|
class BaseModelWithConfig(BaseModel):
|
||||||
routing_key: str
|
routing_key: str
|
||||||
|
@ -40,12 +34,7 @@ def configure_api_providers(
|
||||||
print("Enter comma-separated list of APIs to serve:")
|
print("Enter comma-separated list of APIs to serve:")
|
||||||
|
|
||||||
apis = config.apis_to_serve or list(spec.providers.keys())
|
apis = config.apis_to_serve or list(spec.providers.keys())
|
||||||
apis = [a for a in apis if a != "telemetry"]
|
config.apis_to_serve = [a for a in apis if a != "telemetry"]
|
||||||
req_apis = ReqApis(
|
|
||||||
apis_to_serve=apis,
|
|
||||||
)
|
|
||||||
req_apis = prompt_for_config(ReqApis, req_apis)
|
|
||||||
config.apis_to_serve = req_apis.apis_to_serve
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
apis = [v.value for v in stack_apis()]
|
apis = [v.value for v in stack_apis()]
|
||||||
|
|
|
@ -258,7 +258,7 @@ def prompt_for_config(
|
||||||
|
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
print(
|
print(
|
||||||
"Invalid JSON. Please enter a valid JSON-encoded list."
|
'Invalid JSON. Please enter a valid JSON-encoded list e.g., ["foo","bar"]'
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue