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 479e5f01..d3be9cf9 100644 --- a/gptme/tools/python.py +++ b/gptme/tools/python.py @@ -28,6 +28,7 @@ if TYPE_CHECKING: from IPython.core.interactiveshell import InteractiveShell # fmt: skip + logger = getLogger(__name__) # TODO: launch the IPython session in the current venv, if any, instead of the pipx-managed gptme venv (for example) in which gptme itself runs @@ -245,7 +246,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