Skip to content

Commit

Permalink
Stop asking for "apis to serve" as part of configure
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinb committed Sep 18, 2024
1 parent eea0a83 commit 055770a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions llama_stack/distribution/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
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):
class BaseModelWithConfig(BaseModel):
routing_key: str
Expand All @@ -40,12 +34,7 @@ def configure_api_providers(
print("Enter comma-separated list of APIs to serve:")

apis = config.apis_to_serve or list(spec.providers.keys())
apis = [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
config.apis_to_serve = [a for a in apis if a != "telemetry"]
print("")

apis = [v.value for v in stack_apis()]
Expand Down
2 changes: 1 addition & 1 deletion llama_stack/distribution/utils/prompt_for_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def prompt_for_config(

except json.JSONDecodeError:
print(
"Invalid JSON. Please enter a valid JSON-encoded list."
'Invalid JSON. Please enter a valid JSON-encoded list e.g., ["foo","bar"]'
)
continue
except ValueError as e:
Expand Down

0 comments on commit 055770a

Please sign in to comment.