Skip to content

Commit

Permalink
fix: disable computer tool unless explicitly enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Nov 1, 2024
1 parent 73f093f commit f5d9586
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gptme/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
]
loaded_tools: list[ToolSpec] = []

# Tools that are disabled by default, unless explicitly enabled
# TODO: find a better way to handle this
tools_default_disabled = [
"computer",
]


def init_tools(allowlist=None) -> None:
"""Runs initialization logic for tools."""
Expand All @@ -62,6 +68,9 @@ def init_tools(allowlist=None) -> None:
continue
if tool in loaded_tools:
continue
if tool.name in tools_default_disabled:
if not allowlist or tool.name not in allowlist:
continue
load_tool(tool)

for tool_name in allowlist or []:
Expand Down

0 comments on commit f5d9586

Please sign in to comment.