Elffuss BraidHub

kikocis/llama-stack public

Stop asking for "apis to serve" as part of configure
Changesetb5fccb74b6388c1eacb2cd691a179aec39dc37ca50a3995622412ed44a0d23b6
AuthorAshwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-17 22:40 -07:00
CommitterAshwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-17 22:41 -07:00
Parents8bc845d9f389

Browse the files at this changeset

2 files changed

modified llama_stack/distribution/configure.py +1 −12
@@ -17,12 +17,6 @@
1717 from llama_stack.distribution.utils.prompt_for_config import prompt_for_config
1818
1919
20-# These are hacks so we can re-use the `prompt_for_config` utility
21-# This needs a bunch of work to be made very user friendly.
22-class ReqApis(BaseModel):
23- apis_to_serve: List[str]
24-
25-
2620 def make_routing_entry_type(config_class: Any):
2721 class BaseModelWithConfig(BaseModel):
2822 routing_key: str
@@ -40,12 +34,7 @@
4034 print("Enter comma-separated list of APIs to serve:")
4135
4236 apis = config.apis_to_serve or list(spec.providers.keys())
43- apis = [a for a in apis if a != "telemetry"]
44- req_apis = ReqApis(
45- apis_to_serve=apis,
46- )
47- req_apis = prompt_for_config(ReqApis, req_apis)
48- config.apis_to_serve = req_apis.apis_to_serve
37+ config.apis_to_serve = [a for a in apis if a != "telemetry"]
4938 print("")
5039
5140 apis = [v.value for v in stack_apis()]
modified llama_stack/distribution/utils/prompt_for_config.py +1 −1
@@ -258,7 +258,7 @@
258258
259259 except json.JSONDecodeError:
260260 print(
261- "Invalid JSON. Please enter a valid JSON-encoded list."
261+ 'Invalid JSON. Please enter a valid JSON-encoded list e.g., ["foo","bar"]'
262262 )
263263 continue
264264 except ValueError as e: