mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-02 08:44:44 +00:00
feat(cli): add interactive tab completion for image type selection
This commit is contained in:
parent
59b7593609
commit
8f701a831d
1 changed files with 4 additions and 3 deletions
|
@ -136,12 +136,13 @@ def run_stack_build_command(args: argparse.Namespace) -> None:
|
|||
)
|
||||
|
||||
image_type = prompt(
|
||||
f"> Enter the image type you want your Llama Stack to be built as ({' or '.join(e.value for e in ImageType)}): ",
|
||||
f"> Enter the image type you want your Llama Stack to be built as (use <TAB> to see options): ",
|
||||
completer=WordCompleter([e.value for e in ImageType]),
|
||||
complete_while_typing=True,
|
||||
validator=Validator.from_callable(
|
||||
lambda x: x in [e.value for e in ImageType],
|
||||
error_message=f"Invalid image type, please enter {' or '.join(e.value for e in ImageType)}",
|
||||
error_message="Invalid image type. Use <TAB> to see options",
|
||||
),
|
||||
default=ImageType.CONDA.value,
|
||||
)
|
||||
|
||||
if image_type == ImageType.CONDA.value:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue