kikocis/llama-stack public
Changesets · Branches · Tags · Compare
| Changeset | b5fccb74b6388c1eacb2cd691a179aec39dc37ca50a3995622412ed44a0d23b6 |
|---|---|
| Author | Ashwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-17 22:40 -07:00 |
| Committer | Ashwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-17 22:41 -07:00 |
| Parents | 8bc845d9f389 |
2 files changed
modified llama_stack/distribution/configure.py +1 −12
| @@ -17,12 +17,6 @@ | ||
| 17 | 17 | from llama_stack.distribution.utils.prompt_for_config import prompt_for_config |
| 18 | 18 | |
| 19 | 19 | |
| 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 | - | |
| 26 | 20 | def make_routing_entry_type(config_class: Any): |
| 27 | 21 | class BaseModelWithConfig(BaseModel): |
| 28 | 22 | routing_key: str |
| @@ -40,12 +34,7 @@ | ||
| 40 | 34 | print("Enter comma-separated list of APIs to serve:") |
| 41 | 35 | |
| 42 | 36 | 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"] | |
| 49 | 38 | print("") |
| 50 | 39 | |
| 51 | 40 | apis = [v.value for v in stack_apis()] |
modified llama_stack/distribution/utils/prompt_for_config.py +1 −1
| @@ -258,7 +258,7 @@ | ||
| 258 | 258 | |
| 259 | 259 | except json.JSONDecodeError: |
| 260 | 260 | 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"]' | |
| 262 | 262 | ) |
| 263 | 263 | continue |
| 264 | 264 | except ValueError as e: |