From 955afab8ae004b8fa7aaad9fea3cc3fa7f6bebee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Sun, 22 Dec 2024 14:57:03 +0100 Subject: [PATCH] fix: rename python tool to ipython for better tooluse format adherence --- gptme/tools/__init__.py | 2 +- gptme/tools/python.py | 2 +- tests/test_util_cli.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gptme/tools/__init__.py b/gptme/tools/__init__.py index ea99e3a6..36a5a592 100644 --- a/gptme/tools/__init__.py +++ b/gptme/tools/__init__.py @@ -77,7 +77,7 @@ def init_tools(allowlist: frozenset[str] | None = None) -> None: """Runs initialization logic for tools.""" # init python tool last tools = list( - sorted(ToolSpec.get_tools().values(), key=lambda tool: tool.name != "python") + sorted(ToolSpec.get_tools().values(), key=lambda tool: tool.name != "ipython") ) loaded_tool_names = [tool.name for tool in loaded_tools] for tool in tools: diff --git a/gptme/tools/python.py b/gptme/tools/python.py index 0a829f12..ee37a3b1 100644 --- a/gptme/tools/python.py +++ b/gptme/tools/python.py @@ -245,7 +245,7 @@ def init() -> ToolSpec: tool = ToolSpec( - name="python", + name="ipython", desc="Execute Python code", instructions=instructions, examples=examples, diff --git a/tests/test_util_cli.py b/tests/test_util_cli.py index 897e6642..2dfac946 100644 --- a/tests/test_util_cli.py +++ b/tests/test_util_cli.py @@ -137,9 +137,9 @@ def test_tools_info(): runner = CliRunner() # Test valid tool - result = runner.invoke(main, ["tools", "info", "python"]) + result = runner.invoke(main, ["tools", "info", "ipython"]) assert result.exit_code == 0 - assert "Tool: python" in result.output + assert "Tool: ipython" in result.output assert "Description:" in result.output assert "Instructions:" in result.output