mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-16 17:51:07 +00:00
parent
adb900be1a
commit
0cd9333054
3 changed files with 12 additions and 6 deletions
|
|
@ -287,7 +287,7 @@ Options:
|
|||
--help Show this message and exit.
|
||||
|
||||
Commands:
|
||||
list List current aliases
|
||||
list* List current aliases
|
||||
path Output the path to the aliases.json file
|
||||
remove Remove an alias
|
||||
set Set an alias for a model
|
||||
|
|
|
|||
|
|
@ -674,7 +674,11 @@ def templates_list():
|
|||
click.echo(display_truncated(text))
|
||||
|
||||
|
||||
@cli.group()
|
||||
@cli.group(
|
||||
cls=DefaultGroup,
|
||||
default="list",
|
||||
default_if_no_args=True,
|
||||
)
|
||||
def aliases():
|
||||
"Manage model aliases"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import json
|
|||
import pytest
|
||||
|
||||
|
||||
def test_aliases_list():
|
||||
@pytest.mark.parametrize("args", (["aliases", "list"], ["aliases"]))
|
||||
def test_aliases_list(args):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["aliases", "list"])
|
||||
result = runner.invoke(cli, args)
|
||||
assert result.exit_code == 0
|
||||
assert result.output == (
|
||||
"3.5 : gpt-3.5-turbo\n"
|
||||
|
|
@ -19,9 +20,10 @@ def test_aliases_list():
|
|||
)
|
||||
|
||||
|
||||
def test_aliases_list_json():
|
||||
@pytest.mark.parametrize("args", (["aliases", "list"], ["aliases"]))
|
||||
def test_aliases_list_json(args):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["aliases", "list", "--json"])
|
||||
result = runner.invoke(cli, args + ["--json"])
|
||||
assert result.exit_code == 0
|
||||
assert json.loads(result.output) == {
|
||||
"3.5": "gpt-3.5-turbo",
|
||||
|
|
|
|||
Loading…
Reference in a new issue