Skip to content

Commit

Permalink
External tools, marketplace tools fix (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitlj committed Aug 16, 2023
1 parent b0d4a68 commit 77455ce
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions superagi/agent/tool_builder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import importlib

import os
from superagi.config.config import get_config
from superagi.llms.llm_model_factory import get_model
from superagi.models.tool import Tool
Expand Down Expand Up @@ -58,9 +58,11 @@ def build_tool(self, tool: Tool):
"""
file_name = self.__validate_filename(filename=tool.file_name)

tools_dir = get_config("TOOLS_DIR")
if tools_dir is None:
tools_dir = "superagi/tools"
tool_paths = ["superagi/tools", "superagi/tools/external_tools", "superagi/tools/marketplace_tools"]
for tool_path in tool_paths:
if os.path.exists(os.path.join(os.getcwd(), tool_path) + '/' + tool.folder_name):
tools_dir = tool_path
break
parsed_tools_dir = tools_dir.rstrip("/")
module_name = ".".join(parsed_tools_dir.split("/") + [tool.folder_name, file_name])

Expand Down

0 comments on commit 77455ce

Please sign in to comment.