mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-01 02:14:52 +00:00
Fix for confusing error, closes #1238
This commit is contained in:
parent
9f1417f6e8
commit
e6ac18fbcb
2 changed files with 4 additions and 22 deletions
21
llm/cli.py
21
llm/cli.py
|
|
@ -4019,26 +4019,11 @@ def _gather_tools(
|
|||
tool for tool in tool_specs if tool.split("(")[0] not in registered_tools
|
||||
]
|
||||
if bad_tools:
|
||||
# Are any of them toolbox tools?
|
||||
bad_tool_classes = list(
|
||||
set(
|
||||
bad_tool.split("_")[0]
|
||||
for bad_tool in bad_tools
|
||||
if bad_tool[0].isupper()
|
||||
raise click.ClickException(
|
||||
"Tool(s) {} not found. Available tools: {}".format(
|
||||
", ".join(bad_tools), ", ".join(registered_tools.keys())
|
||||
)
|
||||
)
|
||||
if bad_tool_classes:
|
||||
raise click.ClickException(
|
||||
"Toolbox tools ({}) are not yet supported with llm -c".format(
|
||||
", ".join(bad_tool_classes)
|
||||
)
|
||||
)
|
||||
else:
|
||||
raise click.ClickException(
|
||||
"Tool(s) {} not found. Available tools: {}".format(
|
||||
", ".join(bad_tools), ", ".join(registered_tools.keys())
|
||||
)
|
||||
)
|
||||
for tool_spec in tool_specs:
|
||||
if not tool_spec[0].isupper():
|
||||
# It's a function
|
||||
|
|
|
|||
|
|
@ -779,10 +779,7 @@ def test_register_toolbox(tmpdir, logs_db):
|
|||
["-c", "list them again"],
|
||||
)
|
||||
assert result5.exit_code == 1
|
||||
assert (
|
||||
result5.output
|
||||
== "Error: Toolbox tools (Filesystem) are not yet supported with llm -c\n"
|
||||
)
|
||||
assert "Error: Tool(s) Filesystem_list_files not found. Available tools:" in result5.output
|
||||
|
||||
# Test the logging worked
|
||||
rows = list(logs_db.query(TOOL_RESULTS_SQL))
|
||||
|
|
|
|||
Loading…
Reference in a new issue